Modifier and Type | Method and Description |
---|---|
org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy[] |
editAccessControlPolicies(Principal principal)
Returns an array of editable policies for the given
principal . |
AccessControlPolicy[] |
editAccessControlPolicies(String nodePath)
Retrieves the editable policies for the Node identified by the given
nodePath that are applicable but have not yet have been set.The AccessControlPolicy objects returned are detached from the underlying AccessControlProvider and is only an external
representation. |
org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy[] |
getPolicies(Principal principal)
Retrieves the policies that have been applied before for the given
principal . |
AccessControlPolicy[] |
getPolicies(String nodePath)
Retrieves the policies for the Node identified by the given
nodePath . |
void |
removePolicy(String nodePath,
AccessControlPolicy policy)
Removes the specified policy from the node at
nodePath . |
void |
setPolicy(String nodePath,
AccessControlPolicy policy)
Stores the policy template to the respective node.
|
AccessControlPolicy[] getPolicies(String nodePath) throws AccessControlException, PathNotFoundException, RepositoryException
nodePath
. In contrast to editAccessControlPolicies(java.lang.String)
this method
returns an empty array if no policy has been applied before by calling
setPolicy(java.lang.String, javax.jcr.security.AccessControlPolicy)
). Still the returned policies are detached from
the AccessControlProvider
and are only an external representation.
Modification will therefore not take effect, until they are written back to
the editor and persisted.
Compared to the policy returned by AccessControlProvider.getEffectivePolicies(org.apache.jackrabbit.spi.Path, CompiledPermissions)
,
the scope of the policies it limited to the Node itself and does
not take inherited elements into account.
nodePath
- Absolute path to an existing node object.AccessControlException
- If the Node identified by the given
nodePath
does not allow access control modifications (e.g.
the node itself stores the access control information for its parent).PathNotFoundException
- if no node exists for the given
nodePath
.RepositoryException
- if an error occursorg.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy[] getPolicies(Principal principal) throws AccessControlException, RepositoryException
principal
. In contrast to editAccessControlPolicies(java.lang.String)
this method returns an empty array if no policy has been applied before
by calling setPolicy(java.lang.String, javax.jcr.security.AccessControlPolicy)
). Still the returned policies are detached from
the AccessControlProvider
and are only an external representation.
Modification will therefore not take effect, until they are written back to
the editor and persisted.principal
- Principal for which the editable policies should be
returned.AccessControlException
- if the specified principal does not exist,
if this implementation cannot provide policies for individual principals or
if same other access control related exception occurs.RepositoryException
- if an error occursAccessControlPolicy[] editAccessControlPolicies(String nodePath) throws AccessControlException, PathNotFoundException, RepositoryException
nodePath
that are applicable but have not yet have been set.AccessControlProvider
and is only an external
representation. Modification will therefore not take effect, until a
modified policy is written back to the editor and persisted.
See getPolicies(String)
for the corresponding method that returns
the editable policies that have been set to the node at
nodePath
before.
Compared to the policies returned by AccessControlProvider.getEffectivePolicies(org.apache.jackrabbit.spi.Path, CompiledPermissions)
,
the scope of the policies returned by this methods it limited to the Node
itself and does never not take inherited elements into account.
nodePath
- Absolute path to an existing node object.AccessControlException
- If the Node identified by the given
nodePath
does not allow access control modifications.PathNotFoundException
- if no node exists for the given
nodePath
.RepositoryException
- if an error occursorg.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy[] editAccessControlPolicies(Principal principal) throws AccessDeniedException, AccessControlException, RepositoryException
principal
.principal
- Principal for which the editable policies should be
returned.principal
.AccessDeniedException
- If the editing session is not allowed to
edit policies.AccessControlException
- if the specified principal does not exist,
if this implementation cannot provide policies for individual principals or
if same other access control related exception occurs.RepositoryException
- if another error occurs.void setPolicy(String nodePath, AccessControlPolicy policy) throws AccessControlException, PathNotFoundException, RepositoryException
nodePath
- Absolute path to an existing node object.policy
- the AccessControlPolicy
to store.AccessControlException
- If the policy is null
or
if it is not applicable to the Node identified by the given
nodePath
.PathNotFoundException
- if no node exists for the given
nodePath
.RepositoryException
- if an other error occurs.void removePolicy(String nodePath, AccessControlPolicy policy) throws AccessControlException, PathNotFoundException, RepositoryException
nodePath
.nodePath
- Absolute path to an existing node object.policy
- The policy to be removed at nodePath
.AccessControlException
- If the Node identified by the given
nodePath
does not allow policy modifications or does not have
the specified policy attached.PathNotFoundException
- if no node exists for the given
nodePath
.RepositoryException
- if an other error occursCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.