| javax.jcr.security.AccessControlManager
AccessControlManager | public interface AccessControlManager (Code) | | The AccessControlManager object is accessed via
javax.jcr.Session.getAccessControlManager . It provides methods for:
- Access control discovery
- Assigning access control policies
- Assigning access control entries
since: JCR 2.0 |
Method Summary | |
AccessControlEntry | addAccessControlEntry(String absPath, Principal principal, Privilege[] privileges) Adds the access control entry consisting of the specified
principal and the specified privileges to the
node at absPath .
This method returns the AccessControlEntry object constructed from the
specified principal and contains at least the given privileges .
An implementation may return a resulting ACE that combines the given privileges
with those added by a previous call to addAccessControlEntry for the same
Principal . | void | addPolicy(String absPath, AccessControlPolicy policy) Binds the policy to the node at absPath .
Only one policy may be bound at a time. | AccessControlEntry[] | getAccessControlEntries(String absPath) Returns all access control entries assigned to the node at absPath . | AccessControlPolicy | getEffectivePolicy(String absPath) Performs a best-effort search for the policy in effect on the node at absPath. | AccessControlPolicy | getPolicy(String absPath) Returns the AccessControlPolicy that currently applies to
the node at absPath . | Privilege[] | getPrivileges(String absPath) Returns the privileges the session has for absolute path absPath, which
must be an existing node.
The returned privileges are those for which
AccessControlManager.hasPrivileges would
return true .
The results reported by the this method reflect the net
effect of the currently applied control mechanisms. | AccessControlPolicyIterator | getSupportedPolicies(String absPath) Returns the access control policies that are capable of being applied to
the node at absPath . | Privilege[] | getSupportedPrivileges(String absPath) Returns the privileges supported for absolute path absPath ,
which must be an existing node.
This method does not return the privileges held by the session. | boolean | hasPrivileges(String absPath, Privilege[] privileges) Returns whether the session has the specified privileges for absolute
path absPath , which must be an existing node.
Testing an aggregate privilege is equivalent to testing each nonaggregate
privilege among the set returned by calling
Privilege.getAggregatePrivileges() for that privilege.
The results reported by the this method reflect the net
effect of the currently applied control mechanisms. | void | removeAccessControlEntry(String absPath, AccessControlEntry ace) Removes the specified AccessControlEntry from the node at
absPath .
This method is guaranteed to affect only the privileges of the principal
defined within the passed AccessControlEntry .
This method may affect the privileges granted to that principal
with respect to nodes other than that specified. | AccessControlPolicy | removePolicy(String absPath) Removes the currently applied AccessControlPolicy from the
node at absPath and returns it.
An AccessControlPolicy can only be removed if it was previously
bound to the specified node through this API before. |
addAccessControlEntry | AccessControlEntry addAccessControlEntry(String absPath, Principal principal, Privilege[] privileges) throws PathNotFoundException, PrincipalNotFoundException, AccessDeniedException, RepositoryException(Code) | | Adds the access control entry consisting of the specified
principal and the specified privileges to the
node at absPath .
This method returns the AccessControlEntry object constructed from the
specified principal and contains at least the given privileges .
An implementation may return a resulting ACE that combines the given privileges
with those added by a previous call to addAccessControlEntry for the same
Principal . However, a call to addAccessControlEntry for a given
Principal can never remove a Privilege added by a previous call
to addAccessControlEntry .
The access control entry does not take effect until a save
is performed.
This method is guaranteed to affect only the privileges of the specified
principal .
This method may affect the privileges granted to that principal with
respect to nodes other than that specified. However, if it does, it is
guaranteed to only affect the privileges of those other nodes in the
same way as it affects the privileges of the specified node.
Parameters: absPath - an absolute path Parameters: principal - a Principal Parameters: privileges - an array of Privilege s the AccessControlEntry object constructed from thespecified principal and privileges . throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: PrincipalNotFoundException - if the specified principal does not exist. throws: AccessDeniedException - if the session lacksjcr:setAccessControlPolicy privilege for theabsPath node. throws: RepositoryException - if another error occurs. |
addPolicy | void addPolicy(String absPath, AccessControlPolicy policy) throws PathNotFoundException, PolicyNotFoundException, AccessDeniedException, RepositoryException(Code) | | Binds the policy to the node at absPath .
Only one policy may be bound at a time. If more than one policy per node is
required, the implementation should provide an appropriate aggregate policy
among those returned by getSupportedPolicies(absPath)
The access control policy does not take effect until a save is performed.
If the node has existing access control entries that were bound to it though the JCR API
these entries may be deleted upon execution of the addPolicy call.
Any implementation-specific (non-JCR) access control settings may be changed in response to
a successful call to addPolicy .
Parameters: absPath - an absolute path Parameters: policy - the AccessControlPolicy to be applied throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: PolicyNotFoundException - if no policy exists. throws: AccessDeniedException - if the session lacksGET_ACCESS_CONTROL privilege for theabsPath node. throws: RepositoryException - if another error occurs. |
getEffectivePolicy | AccessControlPolicy getEffectivePolicy(String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException(Code) | | Performs a best-effort search for the policy in effect on the node at absPath.
Since finding the effective policy may be impractical or impossible in certain
implementations, a return value of null may mean either that a policy exists
but the implementation cannot find it, or that there is no effective policy on the node.
Parameters: absPath - an absolute path an AccessControlPolicy object throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: AccessDeniedException - if the session lacksGET_ACCESS_CONTROL privilege for theabsPath node. throws: RepositoryException - if another error occurs. |
getPrivileges | Privilege[] getPrivileges(String absPath) throws PathNotFoundException, RepositoryException(Code) | | Returns the privileges the session has for absolute path absPath, which
must be an existing node.
The returned privileges are those for which
AccessControlManager.hasPrivileges would
return true .
The results reported by the this method reflect the net
effect of the currently applied control mechanisms. It does not reflect
unsaved access control policies or unsaved access control entries (see XX).
Changes to access control status caused by these mechanisms only take effect
on Session.save() and are only then reflected in the results of
the privilege test methods.
Parameters: absPath - an absolute path an array of Privilege s throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: RepositoryException - if another error occurs. |
getSupportedPrivileges | Privilege[] getSupportedPrivileges(String absPath) throws PathNotFoundException, RepositoryException(Code) | | Returns the privileges supported for absolute path absPath ,
which must be an existing node.
This method does not return the privileges held by the session. Instead,
it returns the privileges that the repository supports.
Parameters: absPath - an absolute path an array of Privilege s throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: RepositoryException - if another error occurs. |
hasPrivileges | boolean hasPrivileges(String absPath, Privilege[] privileges) throws PathNotFoundException, RepositoryException(Code) | | Returns whether the session has the specified privileges for absolute
path absPath , which must be an existing node.
Testing an aggregate privilege is equivalent to testing each nonaggregate
privilege among the set returned by calling
Privilege.getAggregatePrivileges() for that privilege.
The results reported by the this method reflect the net
effect of the currently applied control mechanisms. It does not reflect
unsaved access control policies or unsaved access control entries (see XX).
Changes to access control status caused by these mechanisms only take effect
on Session.save() and are only then reflected in the results of
the privilege test methods.
Parameters: absPath - an absolute path Parameters: privileges - an array of Privilege s true if the session has the specified privileges;false otherwise. throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: RepositoryException - if another error occurs. |
removeAccessControlEntry | void removeAccessControlEntry(String absPath, AccessControlEntry ace) throws PathNotFoundException, AccessControlEntryNotFoundException, AccessDeniedException, RepositoryException(Code) | | Removes the specified AccessControlEntry from the node at
absPath .
This method is guaranteed to affect only the privileges of the principal
defined within the passed AccessControlEntry .
This method may affect the privileges granted to that principal
with respect to nodes other than that specified. However, if it does,
it is guaranteed to only affect the privileges of those other nodes in
the same way as it affects the privileges of the specified node.
Only exactly those entries explicitly added though this API can be
removed through this API. The effect of the removal only takes place
upon Session.save() .
Parameters: absPath - an absolute path Parameters: ace - the access control entry to be removed throws: PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node. throws: AccessControlEntryNotFoundException - if the specified entry is notpresent on the specified node. throws: AccessDeniedException - if the session lacksjcr:setAccessControlPolicy privilege for theabsPath node. throws: RepositoryException - if another error occurs. |
|
|