Class GetAclServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, GetAcl

    public class GetAclServlet
    extends AbstractGetAclServlet
    implements GetAcl

    Sling GET servlet implementation for dumping the declared ACL of a resource to JSON.

    Rest Service Description

    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.

    Transport Details:

    Methods

    • GET

    Response

    200
    Success.
    404
    The resource was not found.
    500
    Failure. HTML explains the failure.

    Example Response

    { "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"] } }
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      GetAclServlet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.jcr.security.AccessControlEntry[] getAccessControlEntries​(javax.jcr.Session session, String absPath)  
      javax.json.JsonObject getAcl​(javax.jcr.Session jcrSession, String resourcePath)
      Gets the access control list for a resource.
      • Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet

        doDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayService
      • Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet

        doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
    • Constructor Detail

      • GetAclServlet

        public GetAclServlet()
    • Method Detail

      • getAcl

        public javax.json.JsonObject getAcl​(javax.jcr.Session jcrSession,
                                            String resourcePath)
                                     throws javax.jcr.RepositoryException
        Description copied from interface: GetAcl
        Gets the access control list for a resource.
        Specified by:
        getAcl in interface GetAcl
        Parameters:
        jcrSession - the JCR session of the user updating the user
        resourcePath - The path of the resource to get the ACL for (required)
        Returns:
        the ACL as a JSON object
        Throws:
        javax.jcr.RepositoryException - if any errors reading the information
      • getAccessControlEntries

        protected javax.jcr.security.AccessControlEntry[] getAccessControlEntries​(javax.jcr.Session session,
                                                                                  String absPath)
                                                                           throws javax.jcr.RepositoryException
        Specified by:
        getAccessControlEntries in class AbstractGetAclServlet
        Throws:
        javax.jcr.RepositoryException