public final class OpenPermissionProvider extends java.lang.Object implements PermissionProvider
| Modifier and Type | Method and Description |
|---|---|
static PermissionProvider |
getInstance() |
java.util.Set<java.lang.String> |
getPrivileges(Tree tree)
Returns the set of privilege names which are granted to the set of
Principals associated with this provider instance for the
specified Tree. |
RepositoryPermission |
getRepositoryPermission()
Return the
RepositoryPermission for the set of Principals
associated with this provider instance. |
TreePermission |
getTreePermission(Tree tree,
TreePermission parentPermission)
Return the
TreePermission for the set of Principals associated
with this provider at the specified tree. |
boolean |
hasPrivileges(Tree tree,
java.lang.String... privilegeNames)
Returns whether the principal set associated with this
PrivilegeManager
is granted the privileges identified by the specified privilege names
for the given tree. |
boolean |
isGranted(java.lang.String oakPath,
java.lang.String jcrActions)
Tests if the the specified actions are granted at the given path for
the set of
Principals associated with this provider instance. |
boolean |
isGranted(Tree tree,
PropertyState property,
long permissions)
Test if the specified permissions are granted for the set of
Principals
associated with this provider instance for the item identified by the
given tree and optionally property. |
void |
refresh()
Refresh this
PermissionProvider. |
public static PermissionProvider getInstance()
public void refresh()
PermissionProviderPermissionProvider. The implementation is expected
to subsequently return permission evaluation results that reflect the
most recent revision of the repository.refresh in interface PermissionProviderpublic java.util.Set<java.lang.String> getPrivileges(Tree tree)
PermissionProviderPrincipals associated with this provider instance for the
specified Tree.getPrivileges in interface PermissionProvidertree - The tree for which the privileges should be retrieved.public boolean hasPrivileges(Tree tree, java.lang.String... privilegeNames)
PermissionProviderPrivilegeManager
is granted the privileges identified by the specified privilege names
for the given tree. In order to test for privileges being granted
on a repository level rather than on a particular tree a null tree
should be passed to this method.
Testing a name identifying an aggregate privilege is equivalent to testing each non aggregate privilege name.
hasPrivileges in interface PermissionProvidertree - The tree to test for privileges being granted.privilegeNames - The name of the privileges.true if all privileges are granted; false otherwise.public RepositoryPermission getRepositoryPermission()
PermissionProviderRepositoryPermission for the set of Principals
associated with this provider instance.getRepositoryPermission in interface PermissionProviderRepositoryPermission
for the set of Principals this provider instance has been created for.public TreePermission getTreePermission(Tree tree, TreePermission parentPermission)
PermissionProviderTreePermission for the set of Principals associated
with this provider at the specified tree.getTreePermission in interface PermissionProvidertree - The tree for which the TreePermission object should be built.parentPermission - The TreePermission object that has been
obtained before for the parent tree.TreePermission object for the specified tree.public boolean isGranted(Tree tree, PropertyState property, long permissions)
PermissionProviderPrincipals
associated with this provider instance for the item identified by the
given tree and optionally property. This method will only return true
if all permissions are granted.isGranted in interface PermissionProvidertree - The Tree to test the permissions for.property - A PropertyState if the item to test is a property
or null if the item is a Tree.permissions - The permissions to be tested.true if the specified permissions are granted for the item identified
by the given tree and optionally property state.public boolean isGranted(java.lang.String oakPath,
java.lang.String jcrActions)
PermissionProviderPrincipals associated with this provider instance.
The jcrActions parameter is a comma separated list of action
strings such as defined by javax.jcr.Session and passed to
javax.jcr.Session#hasPermission(String, String). When more than one
action is specified in the jcrActions parameter, this method will
only return true if all of them are granted on the specified path.
isGranted in interface PermissionProvideroakPath - A valid oak path.jcrActions - The JCR actions that should be tested separated by ','true if all actions are granted at the specified path;
false otherwise."Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"