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(PostResponseCreator creator,
java.util.Map<java.lang.String,java.lang.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(SlingHttpServletRequest request,
PostResponse response,
java.util.List<Modification> changes)
Extending Servlet should implement this operation to do the work
|
void |
modifyAce(javax.jcr.Session jcrSession,
java.lang.String resourcePath,
java.lang.String principalId,
java.util.Map<java.lang.String,java.lang.String> privileges,
java.lang.String order)
Add or modify the access control entry for the specified user
or group.
|
void |
modifyAce(javax.jcr.Session jcrSession,
java.lang.String resourcePath,
java.lang.String principalId,
java.util.Map<java.lang.String,java.lang.String> privileges,
java.lang.String order,
boolean autoSave)
Add or modify the access control entry for the specified user
or group.
|
void |
modifyAce(javax.jcr.Session jcrSession,
java.lang.String resourcePath,
java.lang.String principalId,
java.util.Map<java.lang.String,java.lang.String> privileges,
java.lang.String order,
java.util.Map<java.lang.String,javax.jcr.Value> restrictions,
java.util.Map<java.lang.String,javax.jcr.Value[]> mvRestrictions,
java.util.Set<java.lang.String> removeRestrictionNames)
Add or modify the access control entry for the specified user
or group.
|
void |
modifyAce(javax.jcr.Session jcrSession,
java.lang.String resourcePath,
java.lang.String principalId,
java.util.Map<java.lang.String,java.lang.String> privileges,
java.lang.String order,
java.util.Map<java.lang.String,javax.jcr.Value> restrictions,
java.util.Map<java.lang.String,javax.jcr.Value[]> mvRestrictions,
java.util.Set<java.lang.String> removeRestrictionNames,
boolean autoSave)
Add or modify the access control entry for the specified user
or group.
|
protected void |
modifyAce(javax.jcr.Session jcrSession,
java.lang.String resourcePath,
java.lang.String principalId,
java.util.Map<java.lang.String,java.lang.String> privileges,
java.lang.String order,
java.util.Map<java.lang.String,javax.jcr.Value> restrictions,
java.util.Map<java.lang.String,javax.jcr.Value[]> mvRestrictions,
java.util.Set<java.lang.String> removeRestrictionNames,
boolean autoSave,
java.util.List<Modification> changes) |
protected void |
unbindPostResponseCreator(PostResponseCreator creator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Unbind a post response creator
|
protected void |
unbindRestrictionProvider(org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider rp) |
createHtmlResponse, doPost, externalizePath, getAccessControlList, getAccessControlListOrNull, 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(PostResponseCreator creator, java.util.Map<java.lang.String,java.lang.Object> properties)
bindPostResponseCreator
in class AbstractAccessPostServlet
creator
- the response creator service referenceproperties
- the component properties for the service referenceprotected void unbindPostResponseCreator(PostResponseCreator creator, java.util.Map<java.lang.String,java.lang.Object> properties)
AbstractAccessPostServlet
unbindPostResponseCreator
in class AbstractAccessPostServlet
creator
- the response creator service referenceproperties
- the component properties for the service referenceprotected void handleOperation(SlingHttpServletRequest request, PostResponse response, java.util.List<Modification> changes) throws javax.jcr.RepositoryException
AbstractAccessPostServlet
handleOperation
in class AbstractAccessPostServlet
request
- the sling http request to processresponse
- the responsechanges
- the changes to reportjavax.jcr.RepositoryException
- if any errors applying the changespublic void modifyAce(javax.jcr.Session jcrSession, java.lang.String resourcePath, java.lang.String principalId, java.util.Map<java.lang.String,java.lang.String> privileges, java.lang.String order, boolean autoSave) 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.
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 |
autoSave
- true to automatically save changes to the JCR session, false otherwisejavax.jcr.RepositoryException
- if any errors applying the changespublic void modifyAce(javax.jcr.Session jcrSession, java.lang.String resourcePath, java.lang.String principalId, java.util.Map<java.lang.String,java.lang.String> privileges, java.lang.String order) throws javax.jcr.RepositoryException
ModifyAce
ModifyAce.modifyAce(Session, String, String, Map, String, boolean)
with
the autoSave parameter value equal to true.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.
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
- if any errors applying the changespublic void modifyAce(javax.jcr.Session jcrSession, java.lang.String resourcePath, java.lang.String principalId, java.util.Map<java.lang.String,java.lang.String> privileges, java.lang.String order, java.util.Map<java.lang.String,javax.jcr.Value> restrictions, java.util.Map<java.lang.String,javax.jcr.Value[]> mvRestrictions, java.util.Set<java.lang.String> removeRestrictionNames) throws javax.jcr.RepositoryException
ModifyAce
ModifyAce.modifyAce(Session, String, String, Map, String, Map, Map, Set, boolean)
with
the autoSave parameter value equal to true.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.
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
- if any errors applying the changespublic void modifyAce(javax.jcr.Session jcrSession, java.lang.String resourcePath, java.lang.String principalId, java.util.Map<java.lang.String,java.lang.String> privileges, java.lang.String order, java.util.Map<java.lang.String,javax.jcr.Value> restrictions, java.util.Map<java.lang.String,javax.jcr.Value[]> mvRestrictions, java.util.Set<java.lang.String> removeRestrictionNames, boolean autoSave) 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.
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)autoSave
- true to automatically save changes to the JCR session, false otherwisejavax.jcr.RepositoryException
- if any errors applying the changesprotected void modifyAce(javax.jcr.Session jcrSession, java.lang.String resourcePath, java.lang.String principalId, java.util.Map<java.lang.String,java.lang.String> privileges, java.lang.String order, java.util.Map<java.lang.String,javax.jcr.Value> restrictions, java.util.Map<java.lang.String,javax.jcr.Value[]> mvRestrictions, java.util.Set<java.lang.String> removeRestrictionNames, boolean autoSave, java.util.List<Modification> changes) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Copyright © 2022 The Apache Software Foundation. All rights reserved.