Skip to content
Snippets Groups Projects
Commit 692181d3 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

wip

parent f832e3f5
No related branches found
No related tags found
2 merge requests!111Release 0.12.1,!109F select acl
Pipeline #44383 failed
......@@ -31,6 +31,7 @@ import org.caosdb.server.database.BackendTransaction;
import org.caosdb.server.database.exceptions.EntityDoesNotExistException;
import org.caosdb.server.datatype.CollectionValue;
import org.caosdb.server.datatype.IndexedSingleValue;
import org.caosdb.server.accessControl.Principal;
import org.caosdb.server.datatype.ReferenceValue;
import org.caosdb.server.entity.EntityID;
import org.caosdb.server.entity.EntityInterface;
......@@ -60,6 +61,7 @@ import org.caosdb.server.utils.EntityStatus;
public class RetrieveFullEntityTransaction extends BackendTransaction {
private final Container<? extends EntityInterface> container;
private final Principal principal;
public RetrieveFullEntityTransaction(final EntityInterface entity) {
final Container<EntityInterface> c = new Container<>();
......@@ -67,8 +69,9 @@ public class RetrieveFullEntityTransaction extends BackendTransaction {
this.container = c;
}
public RetrieveFullEntityTransaction(final Container<? extends EntityInterface> container) {
public RetrieveFullEntityTransaction(final Container<? extends EntityInterface> container, final Principal principal) {
this.container = container;
this.principal = principal;
}
public RetrieveFullEntityTransaction(final EntityID id) {
......@@ -226,7 +229,7 @@ public class RetrieveFullEntityTransaction extends BackendTransaction {
// check whether the referenced entity may be retrieved
final EntityACL entityACL = ref.getEntityACL();
if (!entityACL.isPermitted(SecurityUtils.getSubject(), EntityPermission.RETRIEVE_ENTITY)) {
if (!entityACL.isPermitted(this.principal, EntityPermission.RETRIEVE_ENTITY)) {
return;
}
// recursion! (Only for the matching selections)
......
......@@ -24,6 +24,8 @@
*/
package org.caosdb.server.entity;
//TODO document the use of this class; it seems to exist of only constructors
public class RetrieveEntity extends Entity {
public RetrieveEntity() {
......
......@@ -77,6 +77,10 @@ import org.caosdb.server.transaction.WriteTransaction;
import org.jdom2.Element;
import org.slf4j.Logger;
// TODO Document: The query is initialized with a RetrieveTransaction and its
// Container. The container is filled by the Query with the resulting IDs. The
// Retrieve transaction then handles the retrieve of all respective Entities.
public class Query implements QueryInterface, ToElementable, EntityTransactionInterface {
/** Class which represents the selection of (sub)properties. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment