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
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessControlEntriesMap
(javax.jcr.Session session, String absPath, Principal principal, Map<Principal, Map<DeclarationType, Set<String>>> declaredAtPaths) protected @Nullable String
getItemPath
(SlingHttpServletRequest request) Return the path where the action should be appliedjakarta.json.JsonObject
getPrincipalAce
(javax.jcr.Session jcrSession, String resourcePath, String principalId) Gets the principal based access control entry for a resource and principalprotected boolean
matchesPrincipalAccessControlEntry
(@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 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.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
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
-
Constructor Details
-
GetPrincipalAceServlet
public GetPrincipalAceServlet()
-
-
Method Details
-
getItemPath
Description copied from class:AbstractAccessGetServlet
Return the path where the action should be applied- Overrides:
getItemPath
in classAbstractAccessGetServlet
-
validateResourcePath
protected void validateResourcePath(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException Description copied from class:AbstractAccessGetServlet
Override if the path does not need to exist- Overrides:
validateResourcePath
in classAbstractAccessGetServlet
- Throws:
javax.jcr.RepositoryException
-
getPrincipalAce
public jakarta.json.JsonObject getPrincipalAce(javax.jcr.Session jcrSession, String resourcePath, String principalId) throws javax.jcr.RepositoryException Description copied from interface:GetPrincipalAce
Gets the principal based access control entry for a resource and principal- Specified by:
getPrincipalAce
in 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, throws javax.jcr.RepositoryExceptionSet<String>>> declaredAtPaths) - Specified by:
getAccessControlEntriesMap
in 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
-