Skip to content
Snippets Groups Projects
Verified Commit 09f53f64 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: state change permissions

parent d0f5981a
No related branches found
No related tags found
3 merge requests!21Release v0.4.0,!7F fsm,!6Draft: F acm permissions2
...@@ -253,7 +253,9 @@ public class EntityACL { ...@@ -253,7 +253,9 @@ public class EntityACL {
public final Element toElement() { public final Element toElement() {
final Element ret = new Element("EntityACL"); final Element ret = new Element("EntityACL");
for (final EntityACI aci : this.acl) { final List<EntityACI> localAcl = new ArrayList<>(this.acl);
localAcl.addAll(GLOBAL_PERMISSIONS.acl);
for (final EntityACI aci : localAcl) {
final boolean isDenial = isDenial(aci.getBitSet()); final boolean isDenial = isDenial(aci.getBitSet());
final boolean isPriority = isPriorityBitSet(aci.getBitSet()); final boolean isPriority = isPriorityBitSet(aci.getBitSet());
final Element e = new Element(isDenial ? "Deny" : "Grant"); final Element e = new Element(isDenial ? "Deny" : "Grant");
......
...@@ -40,6 +40,7 @@ import org.caosdb.server.entity.FileProperties; ...@@ -40,6 +40,7 @@ import org.caosdb.server.entity.FileProperties;
import org.caosdb.server.entity.RetrieveEntity; import org.caosdb.server.entity.RetrieveEntity;
import org.caosdb.server.entity.container.TransactionContainer; import org.caosdb.server.entity.container.TransactionContainer;
import org.caosdb.server.entity.container.UpdateContainer; import org.caosdb.server.entity.container.UpdateContainer;
import org.caosdb.server.entity.wrapper.EntityWrapper;
import org.caosdb.server.entity.wrapper.Parent; import org.caosdb.server.entity.wrapper.Parent;
import org.caosdb.server.entity.wrapper.Property; import org.caosdb.server.entity.wrapper.Property;
import org.caosdb.server.permissions.EntityPermission; import org.caosdb.server.permissions.EntityPermission;
...@@ -239,7 +240,8 @@ public class Update extends WriteTransaction<UpdateContainer> { ...@@ -239,7 +240,8 @@ public class Update extends WriteTransaction<UpdateContainer> {
} }
// entity role // entity role
if (newEntity.hasRole() if (!(newEntity instanceof EntityWrapper)
&& newEntity.hasRole()
&& oldEntity.hasRole() && oldEntity.hasRole()
&& !newEntity.getRole().equals(oldEntity.getRole()) && !newEntity.getRole().equals(oldEntity.getRole())
|| newEntity.hasRole() ^ oldEntity.hasRole()) { || newEntity.hasRole() ^ oldEntity.hasRole()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment