Class AbstractAccessGetServlet

All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AbstractGetAceServlet, AbstractGetAclServlet

public abstract class AbstractAccessGetServlet extends AbstractAccessServlet
See Also:
  • Constructor Details

    • AbstractAccessGetServlet

      public AbstractAccessGetServlet()
  • Method Details

    • doGet

      protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
      Description copied from class: SlingSafeMethodsServlet
      Called by the SlingSafeMethodsServlet.mayService(SlingHttpServletRequest, SlingHttpServletResponse) method to handle an HTTP GET request.

      This default implementation reports back to the client that the method is not supported.

      Implementations of this class should overwrite this method with their implementation for the HTTP GET method support.

      Overrides:
      doGet in class SlingSafeMethodsServlet
      Parameters:
      request - The HTTP request
      response - The HTTP response
      Throws:
      javax.servlet.ServletException - Not thrown by this implementation.
      IOException - If the error status cannot be reported back to the client.
    • getItemPath

      @Nullable protected @Nullable String getItemPath(SlingHttpServletRequest request)
      Return the path where the action should be applied
    • internalJson

      protected abstract jakarta.json.JsonObject internalJson(javax.jcr.Session session, String resourcePath, String principalId) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • validateArgs

      @NotNull protected @NotNull Principal validateArgs(javax.jcr.Session jcrSession, String resourcePath, String principalId) throws javax.jcr.RepositoryException
      Verify that the user supplied arguments are valid
      Parameters:
      jcrSession - the JCR session
      resourcePath - the resource path
      principalId - the principal id
      Returns:
      the principal for the requested principalId
      Throws:
      javax.jcr.RepositoryException
    • validateArgs

      @NotNull protected void validateArgs(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException
      Verify that the user supplied arguments are valid
      Parameters:
      jcrSession - the JCR session
      resourcePath - the resource path
      Throws:
      javax.jcr.RepositoryException
    • validateResourcePath

      protected void validateResourcePath(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException
      Override if the path does not need to exist
      Throws:
      javax.jcr.RepositoryException
    • processACE

      protected void processACE(Map<String,org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionDefinition> srMap, org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry jrAccessControlEntry, javax.jcr.security.Privilege[] privileges, Map<javax.jcr.security.Privilege,LocalPrivilege> map) throws javax.jcr.RepositoryException
      Throws:
      javax.jcr.RepositoryException
    • entriesSortedByEffectivePath

      @NotNull protected @NotNull Map<String,List<javax.jcr.security.AccessControlEntry>> entriesSortedByEffectivePath(@NotNull @NotNull javax.jcr.security.AccessControlPolicy[] policies, @NotNull @NotNull Predicate<? super javax.jcr.security.AccessControlEntry> accessControlEntryFilter, Map<Principal,Map<DeclarationType,Set<String>>> declaredAtPaths) throws javax.jcr.RepositoryException
      Builds a map by merging all the entries for the supplied policies and ordering them by the effective path
      Parameters:
      policies - the policies to process
      accessControlEntryFilter - a filter to find entries to include
      declaredAtPaths - populated with details about where privileges are defined for the principal. In the map the key is the principal and the value is a map of paths the set of defined ACE types at that path.
      Returns:
      map of sorted entries, key is the effectivePath and value is the list of entries for that path
      Throws:
      javax.jcr.RepositoryException