/** * @param acp The ACP to modify * @param aclName the name of the ACL to target * @param principalName the name of the principal (user or group) * @return true if something has changed on the document security */ public static boolean removePermission(ACP acp, String aclName, String principalName) { return acp.removeACEsByUsername(aclName, principalName); }
protected void removePermission(DocumentModel doc) { if (id == null && user == null) { throw new IllegalParameterException("'id' or 'user' parameter must be set"); } ACP acp = doc.getACP() != null ? doc.getACP() : new ACPImpl(); boolean permissionChanged = false; if (user != null) { permissionChanged = acp.removeACEsByUsername(aclName, user); } else if (id != null) { ACE ace = ACE.fromId(id); permissionChanged = acp.removeACE(aclName, ace); } if (permissionChanged) { doc.setACP(acp, true); } }