@Override public ACL getMergedACLs(String name) { ACL mergedAcl = new ACLImpl(name, true); for (ACL acl : acls) { mergedAcl.addAll(acl); } return mergedAcl; }
oldACL.addAll(acl); } else { String name = acl.getName();
/** * Gets default local ACL, i.e. when inheritance * is blocked. * * @return default local ACL */ public static ACL buildDefaultLocalACL(CoreSession session, DocumentModel document) { ACL acl = new ACLImpl(); String currentUser = session.getPrincipal().getName(); acl.add(new ACE(currentUser, SecurityConstants.EVERYTHING)); // acl.addAll(ACEsOperationHelper.getAdminEverythingACEs()); acl.addAll(getMasterOwnerACEs(session, document)); return acl; }
@Override @WebMethod public WsACE[] getDocumentLocalACL(@WebParam(name = "sessionId") String sid, @WebParam(name = "uuid") String uuid) { logDeprecation(); WSRemotingSession rs = initSession(sid); ACP acp = rs.getDocumentManager().getACP(new IdRef(uuid)); if (acp != null) { ACL mergedAcl = new ACLImpl("MergedACL", true); for (ACL acl : acp.getACLs()) { if (!ACL.INHERITED_ACL.equals(acl.getName())) { mergedAcl.addAll(acl); } } return WsACE.wrap(mergedAcl.toArray(new ACE[mergedAcl.size()])); } else { return null; } }
protected ACL getInheritedACLs(Document doc) { doc = doc.getParent(); ACL merged = null; while (doc != null) { ACP acp = getACP(doc); if (acp != null) { ACL acl = acp.getMergedACLs(ACL.INHERITED_ACL); if (merged == null) { merged = acl; } else { merged.addAll(acl); } if (acp.getAccess(SecurityConstants.EVERYONE, SecurityConstants.EVERYTHING) == Access.DENY) { break; } } doc = doc.getParent(); } return merged; }
/** * Finds the first domain by name, and creates under it the root container for the structure containing the route * instances. */ protected DocumentModel createDocumentRoutesStructure(String routeStructureDocType, String id, CoreSession session) { DocumentModel root = session.createDocumentModel(session.getRootDocument().getPathAsString(), id, routeStructureDocType); root.setPropertyValue(DC_TITLE, routeStructureDocType); root = session.createDocument(root); ACP acp = session.getACP(root.getRef()); ACL acl = acp.getOrCreateACL(ACL.LOCAL_ACL); acl.addAll(getACEs()); session.setACP(root.getRef(), acp, true); return root; }