@Override public boolean removeACE(String aclName, ACE ace) { if (aclName == null) { throw new NullPointerException("'aclName' cannot be null"); } ACL acl = getOrCreateACL(aclName); boolean aclChanged = acl.remove(ace); if (aclChanged) { addACL(acl); } return aclChanged; }
/** * Restore inheritance. * * @param session * @param document * @return acp */ protected ACP restoreInheritanceIfNecessary(CoreSession session, DocumentModel document, ACL localAcl) { // ACP ACP acp = document.getACP(); // Remove default rule ACL defaultLocalACL = ACEsOperationHelper.buildDefaultLocalACL(session, document); if (localAcl.containsAll(defaultLocalACL)) { localAcl.removeAll(defaultLocalACL); } // Remove block to restore inheritance ACE blockInACe = ACEsOperationHelper.getBlockInheritanceACe(); if (localAcl.contains(blockInACe)) { localAcl.remove(blockInACe); } // To clear cache acp.addACL(localAcl); return acp; } //
@Override public void run() { DocumentModel instance = session.getDocument(documentRef); if (instance == null) { return; } ACP acp = instance.getACP(); // remove READ for everyone ACL routingACL = acp.getOrCreateACL(DocumentRoutingConstants.DOCUMENT_ROUTING_ACL); routingACL.remove(new ACE(SecurityConstants.EVERYONE, SecurityConstants.READ, true)); // unblock rights inheritance ACL localACL = acp.getOrCreateACL(ACL.LOCAL_ACL); localACL.remove(new ACE(SecurityConstants.EVERYONE, SecurityConstants.EVERYTHING, false)); instance.setACP(acp, true); }