public interface TreePermission
The TreePermission allow to evaluate permissions defined for a given Tree and it's properties.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TreePermission
    TreePermission which always returns true and thus grants all permissions.
    static final TreePermission
    TreePermission which always returns false not granting any permissions.
    static final TreePermission
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return if read access is granted for the Tree associated with this TreePermission instance.
    boolean
    canRead(@NotNull PropertyState property)
    Return if read access is granted for the property of the Tree for which this TreePermission instance has been created.
    boolean
    Returns true if read access is granted to the Tree associated with this instance and the whole subtree defined by it including all properties.
    boolean
    Returns true if all properties of the Tree associated with this instance can be read.
    getChildPermission(@NotNull String childName, @NotNull NodeState childState)
    Retrieve the TreePermission for the tree identified by the specified childName and childState, which is a child of the tree associated with this instanceof TreePermission.
    boolean
    isGranted(long permissions)
    Returns true if all specified permissions are granted on the Tree associated with this TreePermission instance; false otherwise.
    boolean
    isGranted(long permissions, @NotNull PropertyState property)
    Returns true if all specified permissions are granted on the PropertyState associated with this TreePermission instance; false otherwise.
  • Field Details

    • EMPTY

      static final TreePermission EMPTY
      TreePermission which always returns false not granting any permissions.
    • ALL

      static final TreePermission ALL
      TreePermission which always returns true and thus grants all permissions.
    • NO_RECOURSE

      static final TreePermission NO_RECOURSE
  • Method Details

    • getChildPermission

      @NotNull @NotNull TreePermission getChildPermission(@NotNull @NotNull String childName, @NotNull @NotNull NodeState childState)
      Retrieve the TreePermission for the tree identified by the specified childName and childState, which is a child of the tree associated with this instanceof TreePermission.
      Parameters:
      childName - The oak name of the child.
      childState - The child state.
      Returns:
      The tree permission for the child tree identified by childName and childState.
    • canRead

      boolean canRead()
      Return if read access is granted for the Tree associated with this TreePermission 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 the Tree for which this TreePermission 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()
      Returns true if read access is granted to the Tree 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 the Tree associated with this instance as well as its properties and the whole subtree can be read; false otherwise.
    • canReadProperties

      boolean canReadProperties()
      Returns true if all properties of the Tree associated with this instance can be read.
      Returns:
      true if all properties of the Tree associated with this instance can be read; false otherwise.
    • isGranted

      boolean isGranted(long permissions)
      Returns true if all specified permissions are granted on the Tree associated with this TreePermission 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)
      Returns true if all specified permissions are granted on the PropertyState associated with this TreePermission 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.