@Override @WebMethod public WsACE[] getDocumentACL(@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 acl = acp.getMergedACLs("MergedACL"); return WsACE.wrap(acl.toArray(new ACE[acl.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; }
@Override public DocumentSnapshot getDocumentSnapshotExt(@WebParam(name = "sessionId") String sid, @WebParam(name = "uuid") String uuid, @WebParam(name = "useDownloadURL") boolean useDownloadUrl) { WSRemotingSession rs = initSession(sid); DocumentModel doc = rs.getDocumentManager().getDocument(new IdRef(uuid)); DocumentProperty[] props = getDocumentNoBlobProperties(doc, rs); DocumentBlob[] blobs = getDocumentBlobs(doc, rs, useDownloadUrl); ACE[] resACP = null; ACP acp = doc.getACP(); if (acp != null) { ACL acl = acp.getMergedACLs("MergedACL"); resACP = acl.toArray(new ACE[acl.size()]); } DocumentSnapshot ds = new DocumentSnapshot(props, blobs, doc.getPathAsString(), WsACE.wrap(resACP)); return ds; }