Package org.apache.sling.jcr.jackrabbit.accessmanager.post

# Class GetAceServlet

java.lang.Object
jakarta.servlet.GenericServlet
org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet
org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet
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.GetAceServlet

All Implemented Interfaces:
  `jakarta.servlet.Servlet`, `jakarta.servlet.ServletConfig`, `Serializable`, `GetAce`

public class GetAceServlet extends AbstractGetAceServlet implements GetAce

Sling Get Servlet implementation for getting the 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<.ace.json?pid=[principal_id]

### Transport Details:

#### Methods

- GET

#### Get Parameters

pid
  The principal id of the ACE to get in the 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
`GetAceServlet()`

## Method Summary

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)`
`jakarta.json.JsonObject`
`getAce(javax.jcr.Session jcrSession, String resourcePath, String principalId)`
Gets the declared access control entry for a resource and principal

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

`addExtraInfo, internalGetAce, internalJson`

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

`doGet, entriesSortedByEffectivePath, getItemPath, processACE, validateArgs, validateArgs, validateResourcePath`

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

`bindRestrictionProvider, getRestrictionProvider, unbindRestrictionProvider`

### Methods inherited from class org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet

`doDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayService`

### Methods inherited from class org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet

`doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service`

### Methods inherited from class jakarta.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

### GetAceServlet

public GetAceServlet()

## Method Details

### getAce

public jakarta.json.JsonObject getAce(javax.jcr.Session jcrSession, String resourcePath, String principalId) throws javax.jcr.RepositoryException
Description copied from interface: `GetAce`
Gets the declared access control entry for a resource and principal

Specified by:
  `getAce` in interface `GetAce`
Parameters:
  `jcrSession` - the JCR session of the user updating the user
  `resourcePath` - 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:
  `getAccessControlEntriesMap` in class `AbstractGetAceServlet`
Throws:
  `javax.jcr.RepositoryException`