Interface TreePermission
-
public interface TreePermission
TheTreePermission
allow to evaluate permissions defined for a givenTree
and it's properties.
-
-
Field Summary
Fields Modifier and Type Field Description static TreePermission
ALL
TreePermission
which always returnstrue
and thus grants all permissions.static TreePermission
EMPTY
TreePermission
which always returnsfalse
not granting any permissions.static TreePermission
NO_RECOURSE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRead()
Return if read access is granted for theTree
associated with thisTreePermission
instance.boolean
canRead(@NotNull PropertyState property)
Return if read access is granted for the property of theTree
for which thisTreePermission
instance has been created.boolean
canReadAll()
Returnstrue
if read access is granted to theTree
associated with this instance and the whole subtree defined by it including all properties.boolean
canReadProperties()
Returnstrue
if all properties of theTree
associated with this instance can be read.@NotNull TreePermission
getChildPermission(@NotNull java.lang.String childName, @NotNull NodeState childState)
Retrieve theTreePermission
for the tree identified by the specifiedchildName
andchildState
, which is a child of the tree associated with this instanceofTreePermission
.boolean
isGranted(long permissions)
Returnstrue
if all specified permissions are granted on theTree
associated with thisTreePermission
instance;false
otherwise.boolean
isGranted(long permissions, @NotNull PropertyState property)
Returnstrue
if all specified permissions are granted on thePropertyState
associated with thisTreePermission
instance;false
otherwise.
-
-
-
Field Detail
-
EMPTY
static final TreePermission EMPTY
TreePermission
which always returnsfalse
not granting any permissions.
-
ALL
static final TreePermission ALL
TreePermission
which always returnstrue
and thus grants all permissions.
-
NO_RECOURSE
static final TreePermission NO_RECOURSE
-
-
Method Detail
-
getChildPermission
@NotNull @NotNull TreePermission getChildPermission(@NotNull @NotNull java.lang.String childName, @NotNull @NotNull NodeState childState)
Retrieve theTreePermission
for the tree identified by the specifiedchildName
andchildState
, which is a child of the tree associated with this instanceofTreePermission
.- Parameters:
childName
- The oak name of the child.childState
- The child state.- Returns:
- The tree permission for the child tree identified by
childName
andchildState
.
-
canRead
boolean canRead()
Return if read access is granted for theTree
associated with thisTreePermission
instance.- Returns:
true
if the tree associated with this instance can be read;false
otherwise.
-
canRead
boolean canRead(@NotNull @NotNull PropertyState property)
Return if read access is granted for the property of theTree
for which thisTreePermission
instance has been created.- Parameters:
property
- The property to be tested for read access.- Returns:
true
If the specified property can be read;false
otherwise.
-
canReadAll
boolean canReadAll()
Returnstrue
if read access is granted to theTree
associated with this instance and the whole subtree defined by it including all properties. Note, that this includes access to items which require specific read permissions such as e.g.Permissions.READ_ACCESS_CONTROL
.- Returns:
true
if theTree
associated with this instance as well as its properties and the whole subtree can be read;false
otherwise.
-
canReadProperties
boolean canReadProperties()
Returnstrue
if all properties of theTree
associated with this instance can be read.- Returns:
true
if all properties of theTree
associated with this instance can be read;false
otherwise.
-
isGranted
boolean isGranted(long permissions)
Returnstrue
if all specified permissions are granted on theTree
associated with thisTreePermission
instance;false
otherwise.- Parameters:
permissions
- The permissions to be tested. Note, that the implementation may restrict the set of valid permissions to those that can be set and evaluated for trees.- Returns:
true
if all permissions are granted;false
otherwise.
-
isGranted
boolean isGranted(long permissions, @NotNull @NotNull PropertyState property)
Returnstrue
if all specified permissions are granted on thePropertyState
associated with thisTreePermission
instance;false
otherwise.- Parameters:
permissions
- The permissions to be tested. Note, that the implementation may restrict the set of valid permissions to those that can be set and evaluated for properties.property
- The property state for which the permissions must be granted.- Returns:
true
if all permissions are granted;false
otherwise.
-
-