Class GetPrincipalAceServlet

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

    public class GetPrincipalAceServlet
    extends AbstractGetAceServlet
    implements GetPrincipalAce

    Sling Get Servlet implementation for getting the principal based 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<.pace.json?pid=[principal_id]

    Transport Details:

    Methods

    • GET

    Get Parameters

    pid
    The principal id of the ACE to get in the principal 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

      • GetPrincipalAceServlet

        public GetPrincipalAceServlet()
    • Method Detail

      • getPrincipalAce

        public javax.json.JsonObject getPrincipalAce​(javax.jcr.Session jcrSession,
                                                     String resourcePath,
                                                     String principalId)
                                              throws javax.jcr.RepositoryException
        Description copied from interface: GetPrincipalAce
        Gets the principal based access control entry for a resource and principal
        Specified by:
        getPrincipalAce in interface GetPrincipalAce
        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
      • matchesPrincipalAccessControlEntry

        protected boolean matchesPrincipalAccessControlEntry​(@NotNull
                                                             @NotNull javax.jcr.security.AccessControlEntry entry,
                                                             @NotNull
                                                             @NotNull String resourcePath,
                                                             @NotNull
                                                             @NotNull Principal forPrincipal)
        Checks if the entry is for the specified principal and the effective path is equal to the resourcePath
        Parameters:
        entry - the ACE to check
        resourcePath - the resource path
        forPrincipal - the principal
        Returns:
        true for a match, false otherwise