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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractAccessGetServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(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 pathprotected @Nullable StringgetItemPath(org.apache.sling.api.SlingHttpServletRequest request)Return the path where the action should be appliedprotected abstract javax.json.JsonObjectinternalJson(javax.jcr.Session session, String resourcePath, String principalId)protected voidprocessACE(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 voidvalidateArgs(javax.jcr.Session jcrSession, String resourcePath)Verify that the user supplied arguments are validprotected @NotNull PrincipalvalidateArgs(javax.jcr.Session jcrSession, String resourcePath, String principalId)Verify that the user supplied arguments are validprotected voidvalidateResourcePath(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
-
-
-
-
Method Detail
-
doGet
protected void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doGetin classorg.apache.sling.api.servlets.SlingSafeMethodsServlet- Throws:
javax.servlet.ServletExceptionIOException
-
getItemPath
@Nullable protected @Nullable String getItemPath(org.apache.sling.api.SlingHttpServletRequest request)
Return the path where the action should be applied
-
internalJson
protected abstract javax.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.RepositoryExceptionVerify that the user supplied arguments are valid- Parameters:
jcrSession- the JCR sessionresourcePath- the resource pathprincipalId- the principal id- Throws:
javax.jcr.RepositoryException
-
validateResourcePath
protected void validateResourcePath(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryExceptionOverride 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 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
-
-