Interface PermissionHolder

All Known Subinterfaces:
CommandSender, PermissionStateHolder, Player

public interface PermissionHolder
  • Method Details

    • isOperator

      boolean isOperator()
      Returns:
      true if this holder has operator status
    • setOperator

      void setOperator(boolean operator)
      Sets the operator status of this holder.
      Parameters:
      operator - new status
    • permissionState

      TriState permissionState(PermissionNode node)
      Resolves a node against grants, declared defaults and any registered PermissionResolver.
      Parameters:
      node - the node
      Returns:
      the resolved state
    • permissionState

      default TriState permissionState(String node)
      Resolves a node from its textual path.
      Parameters:
      node - node path
      Returns:
      the resolved state
    • hasPermission

      default boolean hasPermission(PermissionNode node)
      Convenience check. Only TriState.TRUE counts as held, so an unresolved node is treated as refused at the call site while still being distinguishable through permissionState(PermissionNode).
      Parameters:
      node - the node
      Returns:
      true if the node resolves to TriState.TRUE
    • hasPermission

      default boolean hasPermission(String node)
      Convenience check from a textual path.
      Parameters:
      node - node path
      Returns:
      true if the node resolves to TriState.TRUE
    • isPermissionDecided

      default boolean isPermissionDecided(String node)
      Tests whether a node has been decided by a grant or a declaration, as opposed to falling through unresolved.
      Parameters:
      node - node path
      Returns:
      true if the state is not TriState.NOT_SET
    • newGrant

      PermissionGrant newGrant(Plugin owner)
      Opens a new revocable set of overrides for this holder.
      Parameters:
      owner - the plugin requesting the grant
      Returns:
      the grant
    • activeOverrides

      Map<PermissionNode, TriState> activeOverrides()
      Returns every override currently applied by active grants, most specific first. Declared defaults are not included; use PermissionRegistry.definitions() for those.
      Returns:
      an immutable snapshot of the active overrides
    • invalidatePermissions

      void invalidatePermissions()
      Drops every cached resolution. Called by the server when operator status changes or when the registry is mutated; plugins rarely need it.