Class GetEffectiveAceServlet

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

    public class GetEffectiveAceServlet
    extends AbstractGetAceServlet
    implements GetEffectiveAce

    Sling Get Servlet implementation for getting the effective ACE for a principal on a JCR resource.

    Rest Service Description

    Get a principal's ACE for the node identified as a resource by the request URL >resource<.eace.json?pid=[principal_id]

    Transport Details:

    Methods

    • GET

    Get Parameters

    pid
    The principal id of the ACE to get in the effective ACL specified by the path.

    Response

    200
    Success.
    404
    The resource was not found or no access control entries exist for the principal.
    500
    Failure. JSON explains the failure.
    See Also:
    Serialized Form
    • Constructor Detail

      • GetEffectiveAceServlet

        public GetEffectiveAceServlet()
    • Method Detail

      • getEffectiveAce

        public javax.json.JsonObject getEffectiveAce​(javax.jcr.Session jcrSession,
                                                     String resourcePath,
                                                     String principalId)
                                              throws javax.jcr.RepositoryException
        Description copied from interface: GetEffectiveAce
        Gets the effective access control entry for a resource and principal
        Specified by:
        getEffectiveAce in interface GetEffectiveAce
        Parameters:
        jcrSession - the JCR session of the user updating the user
        resourcePath - The path of the resource to get the ACE for (required)
        principalId - the principal to get the ACE for (required)
        Returns:
        the ACE as a JSON object
        Throws:
        javax.jcr.RepositoryException - if any errors reading the information
      • addExtraInfo

        protected void addExtraInfo​(javax.json.JsonObjectBuilder principalJson,
                                    Principal principal,
                                    Map<Principal,​Map<DeclarationType,​Set<String>>> principalToDeclaredAtPaths)
        Overridden to add the declaredAt data to the json
        Overrides:
        addExtraInfo in class AbstractGetAceServlet
        principal - the current principal
        principalToDeclaredAtPaths - a map of principal the paths where ACEs are declared