Interface TreePermission
public interface TreePermission
The
TreePermission allow to evaluate permissions defined for a given
Tree and it's properties.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TreePermissionTreePermissionwhich always returnstrueand thus grants all permissions.static final TreePermissionTreePermissionwhich always returnsfalsenot granting any permissions.static final TreePermission -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRead()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.booleanReturnstrueif read access is granted to theTreeassociated with this instance and the whole subtree defined by it including all properties.booleanReturnstrueif all properties of theTreeassociated with this instance can be read.@NotNull TreePermissiongetChildPermission(@NotNull 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 Details
-
EMPTY
TreePermissionwhich always returnsfalsenot granting any permissions. -
ALL
TreePermissionwhich always returnstrueand thus grants all permissions. -
NO_RECOURSE
-
-
Method Details
-
getChildPermission
@NotNull @NotNull TreePermission getChildPermission(@NotNull @NotNull 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
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
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.
-