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
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doGet
(SlingHttpServletRequest request, SlingHttpServletResponse response) Called by theSlingSafeMethodsServlet.mayService(SlingHttpServletRequest, SlingHttpServletResponse)
method to handle an HTTP GET request.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 pathprotected @Nullable String
getItemPath
(SlingHttpServletRequest request) Return the path where the action should be appliedprotected 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 validprotected @NotNull Principal
validateArgs
(javax.jcr.Session jcrSession, String resourcePath, String principalId) Verify that the user supplied arguments are validprotected void
validateResourcePath
(javax.jcr.Session jcrSession, String resourcePath) Override if the path does not need to existMethods 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
-
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 theSlingSafeMethodsServlet.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 classSlingSafeMethodsServlet
- Parameters:
request
- The HTTP requestresponse
- 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
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 sessionresourcePath
- the resource pathprincipalId
- 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 sessionresourcePath
- 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, throws javax.jcr.RepositoryExceptionLocalPrivilege> map) - 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, throws javax.jcr.RepositoryExceptionSet<String>>> declaredAtPaths) Builds a map by merging all the entries for the supplied policies and ordering them by the effective path- Parameters:
policies
- the policies to processaccessControlEntryFilter
- a filter to find entries to includedeclaredAtPaths
- 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
-