/** * @param nodeRef NodeRef * @param acl Acl */ private void replaceWithCleanDefiningAcl(NodeRef nodeRef, Acl acl) { // TODO: could just clear out existing SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties(); properties = new SimpleAccessControlListProperties(); properties.setAclType(ACLType.DEFINING); properties.setInherits(Boolean.FALSE); properties.setVersioned(false); Acl newAcl = aclDaoComponent.createAccessControlList(properties); long id = newAcl.getId(); getACLDAO(nodeRef).setAccessControlList(nodeRef, newAcl); List<AclChange> changes = new ArrayList<AclChange>(); changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, id, acl.getInheritedAcl())); getACLDAO(nodeRef).updateChangedAcls(nodeRef, changes); aclDaoComponent.deleteAccessControlList(acl.getId()); } }
/** * @param nodeRef NodeRef * @param acl Acl */ private void replaceWithCleanDefiningAcl(NodeRef nodeRef, Acl acl) { // TODO: could just clear out existing SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties(); properties = new SimpleAccessControlListProperties(); properties.setAclType(ACLType.DEFINING); properties.setInherits(Boolean.FALSE); properties.setVersioned(false); Acl newAcl = aclDaoComponent.createAccessControlList(properties); long id = newAcl.getId(); getACLDAO(nodeRef).setAccessControlList(nodeRef, newAcl); List<AclChange> changes = new ArrayList<AclChange>(); changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, id, acl.getInheritedAcl())); getACLDAO(nodeRef).updateChangedAcls(nodeRef, changes); aclDaoComponent.deleteAccessControlList(acl.getId()); } }