Class AbstractAccessGetServlet

java.lang.Object
javax.servlet.GenericServlet
org.apache.sling.api.servlets.SlingSafeMethodsServlet
org.apache.sling.api.servlets.SlingAllMethodsServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
     
    protected @NotNull Map<String,List<javax.jcr.security.AccessControlEntry>>
    entriesSortedByEffectivePath(@NotNull javax.jcr.security.AccessControlPolicy[] policies, @NotNull Predicate<? super javax.jcr.security.AccessControlEntry> accessControlEntryFilter, Map<Principal,Map<DeclarationType,Set<String>>> declaredAtPaths)
    Builds a map by merging all the entries for the supplied policies and ordering them by the effective path
    protected @Nullable String
    getItemPath(org.apache.sling.api.SlingHttpServletRequest request)
    Return the path where the action should be applied
    protected abstract jakarta.json.JsonObject
    internalJson(javax.jcr.Session session, String resourcePath, String principalId)
     
    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)
     
    protected void
    validateArgs(javax.jcr.Session jcrSession, String resourcePath)
    Verify that the user supplied arguments are valid
    protected @NotNull Principal
    validateArgs(javax.jcr.Session jcrSession, String resourcePath, String principalId)
    Verify that the user supplied arguments are valid
    protected void
    validateResourcePath(javax.jcr.Session jcrSession, String resourcePath)
    Override if the path does not need to exist

    Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessServlet

    bindRestrictionProvider, getRestrictionProvider, unbindRestrictionProvider

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractAccessGetServlet

      public AbstractAccessGetServlet()
  • Method Details

    • doGet

      protected void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
      Overrides:
      doGet in class org.apache.sling.api.servlets.SlingSafeMethodsServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • getItemPath

      @Nullable protected @Nullable String getItemPath(org.apache.sling.api.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