Interface TreePermission
-
public interface TreePermissionTheTreePermissionallow to evaluate permissions defined for a givenTreeand it's properties.
-
-
Field Summary
Fields Modifier and Type Field Description static TreePermissionALLTreePermissionwhich always returnstrueand thus grants all permissions.static TreePermissionEMPTYTreePermissionwhich always returnsfalsenot granting any permissions.static TreePermissionNO_RECOURSE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanRead()Return if read access is granted for theTreeassociated with thisTreePermissioninstance.booleancanRead(@NotNull PropertyState property)Return if read access is granted for the property of theTreefor which thisTreePermissioninstance has been created.booleancanReadAll()Returnstrueif read access is granted to theTreeassociated with this instance and the whole subtree defined by it including all properties.booleancanReadProperties()Returnstrueif all properties of theTreeassociated with this instance can be read.@NotNull TreePermissiongetChildPermission(@NotNull java.lang.String childName, @NotNull NodeState childState)Retrieve theTreePermissionfor the tree identified by the specifiedchildNameandchildState, which is a child of the tree associated with this instanceofTreePermission.booleanisGranted(long permissions)Returnstrueif all specified permissions are granted on theTreeassociated with thisTreePermissioninstance;falseotherwise.booleanisGranted(long permissions, @NotNull PropertyState property)Returnstrueif all specified permissions are granted on thePropertyStateassociated with thisTreePermissioninstance;falseotherwise.
-
-
-
Field Detail
-
EMPTY
static final TreePermission EMPTY
TreePermissionwhich always returnsfalsenot granting any permissions.
-
ALL
static final TreePermission ALL
TreePermissionwhich always returnstrueand 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 theTreePermissionfor the tree identified by the specifiedchildNameandchildState, 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
childNameandchildState.
-
canRead
boolean canRead()
Return if read access is granted for theTreeassociated with thisTreePermissioninstance.- Returns:
trueif the tree associated with this instance can be read;falseotherwise.
-
canRead
boolean canRead(@NotNull @NotNull PropertyState property)Return if read access is granted for the property of theTreefor which thisTreePermissioninstance has been created.- Parameters:
property- The property to be tested for read access.- Returns:
trueIf the specified property can be read;falseotherwise.
-
canReadAll
boolean canReadAll()
Returnstrueif read access is granted to theTreeassociated 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:
trueif theTreeassociated with this instance as well as its properties and the whole subtree can be read;falseotherwise.
-
canReadProperties
boolean canReadProperties()
Returnstrueif all properties of theTreeassociated with this instance can be read.- Returns:
trueif all properties of theTreeassociated with this instance can be read;falseotherwise.
-
isGranted
boolean isGranted(long permissions)
Returnstrueif all specified permissions are granted on theTreeassociated with thisTreePermissioninstance;falseotherwise.- 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:
trueif all permissions are granted;falseotherwise.
-
isGranted
boolean isGranted(long permissions, @NotNull @NotNull PropertyState property)Returnstrueif all specified permissions are granted on thePropertyStateassociated with thisTreePermissioninstance;falseotherwise.- 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:
trueif all permissions are granted;falseotherwise.
-
-