protected void deleteACL(DocumentRef ref) throws ClientException { ACP acp = session.getACP(ref); acp.removeACL(aclName); acp.removeACL("inherited"); // make sure to not save the inherited acl // which is dynamically computed session.setACP(ref, acp, true); }
protected static void setLocalAcl(CoreSession session, DocumentModel doc, String value) throws ClientException { ACPImpl acp = new ACPImpl(); ACLImpl acl = new ACLImpl(ACL.LOCAL_ACL); acp.addACL(acl); String[] entries = StringUtils.split(value, ',', true); if (entries.length == 0) { return; } for (String entry : entries) { String[] ace = StringUtils.split(entry, ':', true); acl.add(new ACE(ace[0], ace[1], Boolean.parseBoolean(ace[2]))); } session.setACP(doc.getRef(), acp, false); }