@Service(value={javax.servlet.Servlet.class,GetEffectiveAcl.class}) @Property(name="sling.servlet.resourceTypes",value="sling/servlet/default") @Property(name="sling.servlet.methods",value="GET") @Property(name="sling.servlet.selectors",value={"eacl","tidy.eacl"}) @Property(name="sling.servlet.extensions",value="json") public class GetEffectiveAclServlet extends AbstractGetAclServlet implements GetEffectiveAcl
Sling GET servlet implementation for dumping the declared ACL of a resource to JSON.
Mapped to the default resourceType. Gets and Acl for a resource. Get of the form >resource<.acl.json Provided the user has access to the ACL, they get a chunk of JSON of the form.
{
"principalNameA":
{ "granted" : [
"permission1",
"permission2",
"permission3",
"permission4" ],
"denied" : [
"permission5",
"permission6",
"permission7",
"permission8"]
},
"principalNameB":
{ "granted" : [
"permission1",
"permission2",
"permission3",
"permission4" ],
"denied" : [
"permission5",
"permission6",
"permission7",
"permission8"] },
"principalNameC":
{ "granted" : [
"permission1",
"permission2",
"permission3",
"permission4" ],
"denied" : [
"permission5",
"permission6",
"permission7",
"permission8"] }
}
Constructor and Description |
---|
GetEffectiveAclServlet() |
Modifier and Type | Method and Description |
---|---|
protected javax.jcr.security.AccessControlEntry[] |
getAccessControlEntries(javax.jcr.Session session,
String absPath) |
JSONObject |
getEffectiveAcl(javax.jcr.Session jcrSession,
String resourcePath)
Gets the effective access control list for a resource.
|
doGet, internalGetAcl
doDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
public JSONObject getEffectiveAcl(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException, JSONException
GetEffectiveAcl
getEffectiveAcl
in interface GetEffectiveAcl
jcrSession
- the JCR session of the user updating the userresourcePath
- The path of the resource to get the ACL for (required)javax.jcr.RepositoryException
JSONException
protected javax.jcr.security.AccessControlEntry[] getAccessControlEntries(javax.jcr.Session session, String absPath) throws javax.jcr.RepositoryException
getAccessControlEntries
in class AbstractGetAclServlet
javax.jcr.RepositoryException
Copyright © 2014 The Apache Software Foundation. All rights reserved.