if (acl.getAclType() == ACLType.LAYERED) else if (acl.getAclType() == ACLType.DEFINING) List<AclChange> newChanges = aclDaoComponent.mergeInheritedAccessControlList(newParentSharedAclId, childAclId); else if (acl.getAclType() == ACLType.SHARED)
/** * {@inheritDoc} */ @Override public void deleteAclForNode(long aclId) { Acl dbAcl = getAcl(aclId); if (dbAcl.getAclType() == ACLType.DEFINING) { // delete acl members & acl aclCrudDAO.deleteAclMembersByAcl(aclId); aclCrudDAO.deleteAcl(aclId); } if (dbAcl.getAclType() == ACLType.SHARED) { // check unused Long defining = dbAcl.getInheritsFrom(); if (aclCrudDAO.getAcl(defining) == null) { // ADM if (getADMNodesByAcl(aclId, 1).size() == 0) { // delete acl members & acl aclCrudDAO.deleteAclMembersByAcl(aclId); aclCrudDAO.deleteAcl(aclId); } } } }
/** * {@inheritDoc} */ @Override public void deleteAclForNode(long aclId) { Acl dbAcl = getAcl(aclId); if (dbAcl.getAclType() == ACLType.DEFINING) { // delete acl members & acl aclCrudDAO.deleteAclMembersByAcl(aclId); aclCrudDAO.deleteAcl(aclId); } if (dbAcl.getAclType() == ACLType.SHARED) { // check unused Long defining = dbAcl.getInheritsFrom(); if (aclCrudDAO.getAcl(defining) == null) { // ADM if (getADMNodesByAcl(aclId, 1).size() == 0) { // delete acl members & acl aclCrudDAO.deleteAclMembersByAcl(aclId); aclCrudDAO.deleteAcl(aclId); } } } }
if (acl.getAclType() == ACLType.LAYERED) else if (acl.getAclType() == ACLType.DEFINING) List<AclChange> newChanges = aclDaoComponent.mergeInheritedAccessControlList(newParentSharedAclId, childAclId); else if (acl.getAclType() == ACLType.SHARED)
if ((targetAcl.getAclType() != ACLType.DEFINING) && (targetAcl.getAclType() != ACLType.LAYERED)) if ((inheritedAcl.getAclType() == ACLType.DEFINING) || (inheritedAcl.getAclType() == ACLType.LAYERED))
changes.add(new AclDAOImpl.AclChangeImpl(null, id, null, acl.getAclType())); changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, id, null)); getACLDAO(nodeRef).setAccessControlList(nodeRef, acl); List<AclChange> changes; Acl acl; switch (existing.getAclType()) changes.add(new AclDAOImpl.AclChangeImpl(existing.getId(), id, existing.getAclType(), acl.getAclType())); changes.addAll(aclDaoComponent.mergeInheritedAccessControlList(existing.getId(), id)); throw new IllegalStateException("Layering is not supported for DM permissions"); default: throw new IllegalStateException("Unknown type " + existing.getAclType());
if (dbAcl.getAclType() == ACLType.LAYERED) else if (dbAcl.getAclType() == ACLType.DEFINING) else if (dbAcl.getAclType() == ACLType.SHARED)
changes.add(new AclDAOImpl.AclChangeImpl(null, id, null, acl.getAclType())); changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, id, null)); getACLDAO(nodeRef).setAccessControlList(nodeRef, acl); List<AclChange> changes; Acl acl; switch (existing.getAclType()) changes.add(new AclDAOImpl.AclChangeImpl(existing.getId(), id, existing.getAclType(), acl.getAclType())); changes.addAll(aclDaoComponent.mergeInheritedAccessControlList(existing.getId(), id)); throw new IllegalStateException("Layering is not supported for DM permissions"); default: throw new IllegalStateException("Unknown type " + existing.getAclType());
switch (acl.getAclType()) throw new IllegalStateException("Can not delete from this acl in a node context " + acl.getAclType()); case SHARED:
switch (acl.getAclType()) throw new IllegalStateException("Can not delete from this acl in a node context " + acl.getAclType()); case SHARED:
switch (acl.getAclType()) throw new IllegalStateException("Layering is not supported for DM permissions"); default: throw new IllegalStateException("Unknown type " + acl.getAclType());
switch (acl.getAclType()) throw new IllegalStateException("Layering is not supported for DM permissions"); default: throw new IllegalStateException("Unknown type " + acl.getAclType());
switch (acl.getAclType()) throw new IllegalStateException("Can not delete from this acl in a node context " + acl.getAclType()); case DEFINING: case LAYERED:
switch (acl.getAclType()) throw new IllegalStateException("Can not delete from this acl in a node context " + acl.getAclType()); case DEFINING: case LAYERED:
if (target.getAclType() == ACLType.SHARED)
if (target.getAclType() == ACLType.SHARED)
protected CreationReport getMutableAccessControlList(NodeRef nodeRef) { Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef); if (acl == null) { return createAccessControlList(nodeRef, INHERIT_PERMISSIONS_DEFAULT, null); } else { switch (acl.getAclType()) { case FIXED: case GLOBAL: case SHARED: case LAYERED: // We can not set an ACL on node that has one of these types so we need to make a new one .... return createAccessControlList(nodeRef, INHERIT_PERMISSIONS_DEFAULT, acl); case DEFINING: case OLD: default: // Force a copy on write if one is required getACLDAO(nodeRef).forceCopy(nodeRef); acl = getACLDAO(nodeRef).getAccessControlList(nodeRef); return new CreationReport(acl, Collections.<AclChange> emptyList()); } } }
protected CreationReport getMutableAccessControlList(NodeRef nodeRef) { Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef); if (acl == null) { return createAccessControlList(nodeRef, INHERIT_PERMISSIONS_DEFAULT, null); } else { switch (acl.getAclType()) { case FIXED: case GLOBAL: case SHARED: case LAYERED: // We can not set an ACL on node that has one of these types so we need to make a new one .... return createAccessControlList(nodeRef, INHERIT_PERMISSIONS_DEFAULT, acl); case DEFINING: case OLD: default: // Force a copy on write if one is required getACLDAO(nodeRef).forceCopy(nodeRef); acl = getACLDAO(nodeRef).getAccessControlList(nodeRef); return new CreationReport(acl, Collections.<AclChange> emptyList()); } } }
if (targetNodeAcl.getAclType() == ACLType.DEFINING)
if (targetNodeAcl.getAclType() == ACLType.DEFINING)