Interface PermissionTree

All Known Subinterfaces:
MutablePermissionTree

public interface PermissionTree
A tree of permissions. A fancy radix tree if you will.
  • Field Details

    • PERMISSION_PATTERN

      static final Pattern PERMISSION_PATTERN
      Regex pattern used to validate permission strings.

      Notes:

      Permission strings are composed of a series of nodes separated by dots with alphanumeric characters and minus signs, such as "plugin.command".
      A parent node is always overridden by a child node, such as "plugin.command" overriding "plugin".
      Wildcards are also allowed, but they currently have the same effect as a normal node, such as "plugin.command.*" equals "plugin.command".
      The only relevant use of wildcards is the root permission "*" permission. It allows you to set a default value for all permissions.
  • Method Details

    • empty

      static PermissionTree empty()
      Returns an immutable empty permission tree.
    • all

      static PermissionTree all()
      Returns an immutable permission tree with all permissions.
    • from

      static PermissionTree from(PermissionTree tree)
      Creates an immutable permission tree with the given tree.
      Parameters:
      tree - the tree
      Returns:
      the immutable tree
    • getPermission

      TriState getPermission(String permission)
      Get the permission state for a given permission.
      Parameters:
      permission - the permission
      Returns:
      the permission state
    • getPermissions

      Map<String,Boolean> getPermissions()
      A flattened map of permissions.