@Service(value={javax.servlet.Servlet.class,GetAcl.class}) @Property(name="sling.servlet.resourceTypes",value="sling/servlet/default") @Property(name="sling.servlet.methods",value="GET") @Property(name="sling.servlet.selectors",value={"acl","tidy.acl"}) @Property(name="sling.servlet.extensions",value="json") public class GetAclServlet extends AbstractGetAclServlet implements GetAcl
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 |
---|
GetAclServlet() |
Modifier and Type | Method and Description |
---|---|
protected javax.jcr.security.AccessControlEntry[] |
getAccessControlEntries(javax.jcr.Session session,
String absPath) |
JSONObject |
getAcl(javax.jcr.Session jcrSession,
String resourcePath)
Gets the access control list for a resource.
|
doGet, internalGetAcl
doDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
public JSONObject getAcl(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException, JSONException
GetAcl
getAcl
in interface GetAcl
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 © 2015 The Apache Software Foundation. All rights reserved.