public class ModifyAceServlet extends AbstractAccessPostServlet implements ModifyAce
Sling Post Servlet implementation for modifying the ACEs for a principal on a JCR resource.
Modify a principal's ACEs for the node identified as a resource by the request URL >resource<.modifyAce.html
The principalId is assumed to refer directly to an Authorizable, that comes direct from the UserManager. This can be a group or a user, but if its a group, denied permissions will not be added to the group. The group will only contain granted privileges.
Constructor and Description |
---|
ModifyAceServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator,
Map<String,Object> properties)
Overridden since the @Reference annotation is not inherited from the super method
|
protected void |
bindRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider rp) |
protected void |
handleOperation(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.servlets.post.PostResponse response,
List<org.apache.sling.servlets.post.Modification> changes)
Extending Servlet should implement this operation to do the work
|
void |
modifyAce(javax.jcr.Session jcrSession,
String resourcePath,
String principalId,
Map<String,String> privileges,
String order)
Add or modify the access control entry for the specified user
or group.
|
void |
modifyAce(javax.jcr.Session jcrSession,
String resourcePath,
String principalId,
Map<String,String> privileges,
String order,
Map<String,javax.jcr.Value> restrictions,
Map<String,javax.jcr.Value[]> mvRestrictions,
Set<String> removeRestrictionNames)
Add or modify the access control entry for the specified user
or group.
|
protected void |
unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator,
Map<String,Object> properties)
Unbind a post response creator
|
protected void |
unbindRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider rp) |
createHtmlResponse, doPost, externalizePath, getAccessControlList, getItemPath, getRedirectUrl, getRedirectUrl, handleOperation, isSetStatus
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
protected void bindRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider rp)
protected void unbindRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider rp)
protected void bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)
bindPostResponseCreator
in class AbstractAccessPostServlet
org.apache.sling.jackrabbit.usermanager.impl.post.AbstractPostServlet#bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator, java.util.Map)
protected void unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)
AbstractAccessPostServlet
unbindPostResponseCreator
in class AbstractAccessPostServlet
protected void handleOperation(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.servlets.post.PostResponse response, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
AbstractAccessPostServlet
handleOperation
in class AbstractAccessPostServlet
request
- the sling http request to processresponse
- the responsejavax.jcr.RepositoryException
public void modifyAce(javax.jcr.Session jcrSession, String resourcePath, String principalId, Map<String,String> privileges, String order) throws javax.jcr.RepositoryException
ModifyAce
modifyAce
in interface ModifyAce
jcrSession
- the JCR session of the user updating the userresourcePath
- The absolute path of the resource to apply the ACE to (required)principalId
- The name of the user/group to provision (required)privileges
- Map of privileges to apply. (optional)order
- where the access control entry should go in the list.
Value should be one of these:
null | If the ACE for the principal doesn't exist add at the end, otherwise leave the ACE at it's current position. |
first | Place the target ACE as the first amongst its siblings |
last | Place the target ACE as the last amongst its siblings |
before xyz | Place the target ACE immediately before the sibling whose name is xyz |
after xyz | Place the target ACE immediately after the sibling whose name is xyz |
numeric | Place the target ACE at the specified numeric index |
javax.jcr.RepositoryException
public void modifyAce(javax.jcr.Session jcrSession, String resourcePath, String principalId, Map<String,String> privileges, String order, Map<String,javax.jcr.Value> restrictions, Map<String,javax.jcr.Value[]> mvRestrictions, Set<String> removeRestrictionNames) throws javax.jcr.RepositoryException
ModifyAce
modifyAce
in interface ModifyAce
jcrSession
- the JCR session of the user updating the userresourcePath
- The absolute path of the resource to apply the ACE to (required)principalId
- The name of the user/group to provision (required)privileges
- Map of privileges to apply. (optional)order
- where the access control entry should go in the list.
Value should be one of these:
null | If the ACE for the principal doesn't exist add at the end, otherwise leave the ACE at it's current position. |
first | Place the target ACE as the first amongst its siblings |
last | Place the target ACE as the last amongst its siblings |
before xyz | Place the target ACE immediately before the sibling whose name is xyz |
after xyz | Place the target ACE immediately after the sibling whose name is xyz |
numeric | Place the target ACE at the specified numeric index |
restrictions
- Map of single-value restrictions to apply. (optional)mvRestrictions
- Map of multi-value restrictions to apply. (optional)removeRestrictionNames
- Set of existing restriction names to remove (optional)javax.jcr.RepositoryException
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.