Interface PermissionRegistry


public interface PermissionRegistry
  • Method Details

    • define

      Declares a permission, replacing any previous declaration for the same node.
      Parameters:
      definition - the definition
      Returns:
      the previous definition, if any
    • defineAll

      void defineAll(Collection<PermissionDefinition> definitions)
      Declares several permissions at once, bumping revision() only once.
      Parameters:
      definitions - the definitions
    • undefine

      boolean undefine(PermissionNode node)
      Removes a declaration.
      Parameters:
      node - the node
      Returns:
      true if something was removed
    • definition

      Looks up a declaration by exact node.
      Parameters:
      node - the node
      Returns:
      the declaration, if any
    • definitions

      Returns:
      an immutable snapshot of every declaration
    • declaredDefault

      default TriState declaredDefault(PermissionNode node, boolean operator)
      Resolves the declared default for a node, walking its PermissionNode.lookupChain() so that a declaration on fidorial.command.* applies to fidorial.command.weather.
      Parameters:
      node - the node
      operator - whether the holder is an operator
      Returns:
      the declared default, TriState.NOT_SET when nothing is declared
    • revision

      long revision()
      Monotonic counter bumped on every mutation. Holders compare it against the value they cached to know whether their resolved permissions are stale.
      Returns:
      the current revision