Class OpenPermissionProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authorization.permission.OpenPermissionProvider
-
- All Implemented Interfaces:
PermissionProvider
public final class OpenPermissionProvider extends Object implements PermissionProvider
Permission provider implementation that grants full access everywhere.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PermissionProvider
getInstance()
@NotNull Set<String>
getPrivileges(@Nullable Tree tree)
Returns the set of privilege names which are granted to the set ofPrincipal
s associated with this provider instance for the specifiedTree
.@NotNull RepositoryPermission
getRepositoryPermission()
Return theRepositoryPermission
for the set ofPrincipal
s associated with this provider instance.@NotNull TreePermission
getTreePermission(@NotNull Tree tree, @NotNull TreePermission parentPermission)
Return theTreePermission
for the set ofPrincipal
s associated with this provider at the specifiedtree
.boolean
hasPrivileges(@Nullable Tree tree, @NotNull String... privilegeNames)
Returns whether the principal set associated with thisPrivilegeManager
is granted the privileges identified by the specified privilege names for the giventree
.boolean
isGranted(@NotNull String oakPath, @NotNull String jcrActions)
Tests if the the specified actions are granted at the given path for the set ofPrincipal
s associated with this provider instance.boolean
isGranted(@NotNull Tree tree, @Nullable PropertyState property, long permissions)
Test if the specified permissions are granted for the set ofPrincipal
s associated with this provider instance for the item identified by the given tree and optionally property.void
refresh()
Refresh thisPermissionProvider
.
-
-
-
Method Detail
-
getInstance
public static PermissionProvider getInstance()
-
refresh
public void refresh()
Description copied from interface:PermissionProvider
Refresh thisPermissionProvider
. The implementation is expected to subsequently return permission evaluation results that reflect the most recent revision of the repository.- Specified by:
refresh
in interfacePermissionProvider
-
getPrivileges
@NotNull public @NotNull Set<String> getPrivileges(@Nullable @Nullable Tree tree)
Description copied from interface:PermissionProvider
Returns the set of privilege names which are granted to the set ofPrincipal
s associated with this provider instance for the specifiedTree
.- Specified by:
getPrivileges
in interfacePermissionProvider
- Parameters:
tree
- Thetree
for which the privileges should be retrieved.- Returns:
- set of privilege names
-
hasPrivileges
public boolean hasPrivileges(@Nullable @Nullable Tree tree, @NotNull @NotNull String... privilegeNames)
Description copied from interface:PermissionProvider
Returns whether the principal set associated with thisPrivilegeManager
is granted the privileges identified by the specified privilege names for the giventree
. In order to test for privileges being granted on a repository level rather than on a particular tree anull
tree should be passed to this method.Testing a name identifying an aggregate privilege is equivalent to testing each non aggregate privilege name.
- Specified by:
hasPrivileges
in interfacePermissionProvider
- Parameters:
tree
- The tree to test for privileges being granted.privilegeNames
- The name of the privileges.- Returns:
true
if all privileges are granted;false
otherwise.
-
getRepositoryPermission
@NotNull public @NotNull RepositoryPermission getRepositoryPermission()
Description copied from interface:PermissionProvider
Return theRepositoryPermission
for the set ofPrincipal
s associated with this provider instance.- Specified by:
getRepositoryPermission
in interfacePermissionProvider
- Returns:
- The
RepositoryPermission
for the set ofPrincipal
s this provider instance has been created for.
-
getTreePermission
@NotNull public @NotNull TreePermission getTreePermission(@NotNull @NotNull Tree tree, @NotNull @NotNull TreePermission parentPermission)
Description copied from interface:PermissionProvider
Return theTreePermission
for the set ofPrincipal
s associated with this provider at the specifiedtree
.- Specified by:
getTreePermission
in interfacePermissionProvider
- Parameters:
tree
- The tree for which theTreePermission
object should be built.parentPermission
- TheTreePermission
object that has been obtained before for the parent tree.- Returns:
- The
TreePermission
object for the specifiedtree
.
-
isGranted
public boolean isGranted(@NotNull @NotNull Tree tree, @Nullable @Nullable PropertyState property, long permissions)
Description copied from interface:PermissionProvider
Test if the specified permissions are granted for the set ofPrincipal
s associated with this provider instance for the item identified by the given tree and optionally property. This method will only returntrue
if all permissions are granted.- Specified by:
isGranted
in interfacePermissionProvider
- Parameters:
tree
- TheTree
to test the permissions for.property
- APropertyState
if the item to test is a property ornull
if the item is aTree
.permissions
- The permissions to be tested.- Returns:
true
if the specified permissions are granted for the item identified by the given tree and optionally property state.
-
isGranted
public boolean isGranted(@NotNull @NotNull String oakPath, @NotNull @NotNull String jcrActions)
Description copied from interface:PermissionProvider
Tests if the the specified actions are granted at the given path for the set ofPrincipal
s associated with this provider instance.The
jcrActions
parameter is a comma separated list of action strings such as defined bySession
and passed toSession.hasPermission(String, String)
. When more than one action is specified in thejcrActions
parameter, this method will only returntrue
if all of them are granted on the specified path.- Specified by:
isGranted
in interfacePermissionProvider
- Parameters:
oakPath
- A valid oak path.jcrActions
- The JCR actions that should be tested separated by ','- Returns:
true
if all actions are granted at the specified path;false
otherwise.
-
-