Interface PermissionContainer

All Known Subinterfaces:
MutablePermissionTree, PermissionTree
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PermissionContainer
A generic permission container.
  • Method Details

    • isValidPermission

      static boolean isValidPermission(String permission)
      A method used to validate permission strings.

      Notes:

      Permission strings are composed of a series of nodes separated by dots with alphanumeric characters, underscores and minus signs, such as "plugin.my-command", "some_value, etc.
      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 "*". It allows you to set a default value for all permissions.
    • empty

      static PermissionContainer empty()
      Returns an empty permission container. Always returns TriState.UNDEFINED.
    • all

      static PermissionContainer all()
      Returns a permission container that always returns TriState.TRUE.
    • getPermission

      TriState getPermission(String permission)
      Returns the permission state of the given permission.
      Parameters:
      permission - the permission to check
      Returns:
      the permission state