Class GetPrincipalAceServlet
- 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
-
- org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractGetAceServlet
-
- org.apache.sling.jcr.jackrabbit.accessmanager.post.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 Summary
Constructors Constructor Description GetPrincipalAceServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,List<javax.jcr.security.AccessControlEntry>>getAccessControlEntriesMap(javax.jcr.Session session, String absPath, Principal principal, Map<Principal,Map<DeclarationType,Set<String>>> declaredAtPaths)protected @Nullable StringgetItemPath(org.apache.sling.api.SlingHttpServletRequest request)Return the path where the action should be appliedjavax.json.JsonObjectgetPrincipalAce(javax.jcr.Session jcrSession, String resourcePath, String principalId)Gets the principal based access control entry for a resource and principalprotected booleanmatchesPrincipalAccessControlEntry(@NotNull javax.jcr.security.AccessControlEntry entry, @NotNull String resourcePath, @NotNull Principal forPrincipal)Checks if the entry is for the specified principal and the effective path is equal to the resourcePathprotected 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.AbstractGetAceServlet
addExtraInfo, getAccessControlEntries, internalGetAce, internalJson
-
Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessGetServlet
doGet, entriesSortedByEffectivePath, processACE, validateArgs, validateArgs
-
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
-
getItemPath
@Nullable protected @Nullable String getItemPath(org.apache.sling.api.SlingHttpServletRequest request)
Description copied from class:AbstractAccessGetServletReturn the path where the action should be applied- Overrides:
getItemPathin classAbstractAccessGetServlet
-
validateResourcePath
protected void validateResourcePath(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryExceptionDescription copied from class:AbstractAccessGetServletOverride if the path does not need to exist- Overrides:
validateResourcePathin classAbstractAccessGetServlet- Throws:
javax.jcr.RepositoryException
-
getPrincipalAce
public javax.json.JsonObject getPrincipalAce(javax.jcr.Session jcrSession, String resourcePath, String principalId) throws javax.jcr.RepositoryExceptionDescription copied from interface:GetPrincipalAceGets the principal based access control entry for a resource and principal- Specified by:
getPrincipalAcein interfaceGetPrincipalAce- Parameters:
jcrSession- the JCR session of the user updating the userresourcePath- 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
-
getAccessControlEntriesMap
protected Map<String,List<javax.jcr.security.AccessControlEntry>> getAccessControlEntriesMap(javax.jcr.Session session, String absPath, Principal principal, Map<Principal,Map<DeclarationType,Set<String>>> declaredAtPaths) throws javax.jcr.RepositoryException
- Specified by:
getAccessControlEntriesMapin classAbstractGetAceServlet- Throws:
javax.jcr.RepositoryException
-
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 checkresourcePath- the resource pathforPrincipal- the principal- Returns:
- true for a match, false otherwise
-
-