Class GetEffectiveAclServlet
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.AbstractGetAclServlet
org.apache.sling.jcr.jackrabbit.accessmanager.post.GetEffectiveAclServlet
- All Implemented Interfaces:
- Serializable,- javax.servlet.Servlet,- javax.servlet.ServletConfig,- GetEffectiveAcl
Sling GET servlet implementation for dumping the declared ACL of a resource to JSON.
Rest Service Description
Mapped to the default resourceType. Gets and Acl for a resource. Get of the form >resource<.acl.json Provided the user has access to the ACL, they get a chunk of JSON of the form.
Transport Details:
Methods
- GET
Response
- 200
- Success.
- 404
- The resource was not found.
- 500
- Failure. HTML explains the failure.
Example Response
 {
 "principalNameA":{ 
    "permissions": {
      "permission1":{
           "allow":true
      },
      "permission2":{
           "allow":true
      },
      "permission5":{
           "deny":true
      }
    },
 "principalNameB":{ 
    "permissions": {
      "permission1":{
           "allow":true
      },
      "permission2":{
           "allow":[
              "restrictionName1: "restrictionValue1",
              "restrictionName2: [
                  "restrictionValue2a",
                  "restrictionValue2b"
              ]
           ]
      },
      "permission5":{
           "deny":true
      }
    }
 }
 - See Also:
- 
Field SummaryFields inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractGetAclServletKEY_DENIED, KEY_GRANTED, KEY_ORDER
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddExtraInfo(jakarta.json.JsonObjectBuilder principalJson, Principal principal, Map<Principal, Map<DeclarationType, Set<String>>> principalToDeclaredAtPaths) Overridden to add the declaredAt data to the jsongetAccessControlEntriesMap(javax.jcr.Session session, String absPath, Map<Principal, Map<DeclarationType, Set<String>>> declaredAtPaths) jakarta.json.JsonObjectgetEffectiveAcl(javax.jcr.Session jcrSession, String resourcePath) Gets the effective access control list for a resource.Methods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractGetAclServletaddRestrictions, addTo, addTo, convertToJson, getAccessControlEntries, internalGetAcl, internalJsonMethods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessGetServletdoGet, entriesSortedByEffectivePath, getItemPath, processACE, validateArgs, validateArgs, validateResourcePathMethods inherited from class org.apache.sling.jcr.jackrabbit.accessmanager.post.AbstractAccessServletbindRestrictionProvider, getRestrictionProvider, unbindRestrictionProviderMethods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServletdoDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayServiceMethods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServletdoGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, serviceMethods inherited from class javax.servlet.GenericServletdestroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
- 
Constructor Details- 
GetEffectiveAclServletpublic GetEffectiveAclServlet()
 
- 
- 
Method Details- 
getEffectiveAclpublic jakarta.json.JsonObject getEffectiveAcl(javax.jcr.Session jcrSession, String resourcePath) throws javax.jcr.RepositoryException Description copied from interface:GetEffectiveAclGets the effective access control list for a resource.- Specified by:
- getEffectiveAclin interface- GetEffectiveAcl
- Parameters:
- jcrSession- the JCR session of the user updating the user
- resourcePath- The path of the resource to get the ACL for (required)
- Returns:
- the ACL as a JSON object
- Throws:
- javax.jcr.RepositoryException- if any errors reading the information
 
- 
addExtraInfoprotected void addExtraInfo(jakarta.json.JsonObjectBuilder principalJson, Principal principal, Map<Principal, Map<DeclarationType, Set<String>>> principalToDeclaredAtPaths) Overridden to add the declaredAt data to the json- Overrides:
- addExtraInfoin class- AbstractGetAclServlet
- Parameters:
- principalJson- the current principal JSON builder
- principal- the current principal
- principalToDeclaredAtPaths- a map of principal the paths where ACEs are declared
 
- 
getAccessControlEntriesMapprotected Map<String,List<javax.jcr.security.AccessControlEntry>> getAccessControlEntriesMap(javax.jcr.Session session, String absPath, Map<Principal, Map<DeclarationType, throws javax.jcr.RepositoryExceptionSet<String>>> declaredAtPaths) - Specified by:
- getAccessControlEntriesMapin class- AbstractGetAclServlet
- Throws:
- javax.jcr.RepositoryException
 
 
-