Class GetEffectiveAceServlet
- 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.GetEffectiveAceServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,GetEffectiveAce
public class GetEffectiveAceServlet extends AbstractGetAceServlet implements GetEffectiveAce
Sling Get Servlet implementation for getting the effective 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<.eace.json?pid=[principal_id]
Transport Details:
Methods
- GET
Get Parameters
- pid
- The principal id of the ACE to get in the effective 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 GetEffectiveAceServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addExtraInfo(javax.json.JsonObjectBuilder principalJson, Principal principal, Map<Principal,Map<DeclarationType,Set<String>>> principalToDeclaredAtPaths)
Overridden to add the declaredAt data to the jsonprotected Map<String,List<javax.jcr.security.AccessControlEntry>>
getAccessControlEntriesMap(javax.jcr.Session session, String absPath, Principal principal, Map<Principal,Map<DeclarationType,Set<String>>> declaredAtPaths)
javax.json.JsonObject
getEffectiveAce(javax.jcr.Session jcrSession, String resourcePath, String principalId)
Gets the effective access control entry for a resource and principal-
Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractGetAceServlet
getAccessControlEntries, 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.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
-
getEffectiveAce
public javax.json.JsonObject getEffectiveAce(javax.jcr.Session jcrSession, String resourcePath, String principalId) throws javax.jcr.RepositoryException
Description copied from interface:GetEffectiveAce
Gets the effective access control entry for a resource and principal- Specified by:
getEffectiveAce
in interfaceGetEffectiveAce
- 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
-
addExtraInfo
protected void addExtraInfo(javax.json.JsonObjectBuilder principalJson, Principal principal, Map<Principal,Map<DeclarationType,Set<String>>> principalToDeclaredAtPaths)
Overridden to add the declaredAt data to the json- Overrides:
addExtraInfo
in classAbstractGetAceServlet
principal
- the current principalprincipalToDeclaredAtPaths
- a map of principal the paths where ACEs are declared
-
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 classAbstractGetAceServlet
- Throws:
javax.jcr.RepositoryException
-
-