Interface PermissionGrant

All Superinterfaces:
AutoCloseable

public interface PermissionGrant extends AutoCloseable
  • Method Details

    • owner

      Plugin owner()
      Returns:
      the plugin this grant belongs to
    • holder

      Returns:
      the holder this grant applies to
    • set

      Sets the state of a node.
      Parameters:
      node - the node
      state - the state; TriState.NOT_SET removes the override
      Returns:
      this grant, for chaining
      Throws:
      IllegalStateException - if the grant has been revoked
    • allow

      default PermissionGrant allow(String node)
      Grants a node.
      Parameters:
      node - node path
      Returns:
      this grant, for chaining
    • deny

      default PermissionGrant deny(String node)
      Refuses a node, overriding any broader grant.
      Parameters:
      node - node path
      Returns:
      this grant, for chaining
    • unset

      default PermissionGrant unset(String node)
      Drops an override, letting resolution fall through to the next source.
      Parameters:
      node - node path
      Returns:
      this grant, for chaining
    • overrides

      Map<PermissionNode, TriState> overrides()
      Returns:
      an immutable snapshot of the overrides carried by this grant
    • revoked

      boolean revoked()
      Returns:
      true once revoke() has been called
    • revoke

      void revoke()
      Removes every override of this grant from the holder. Calling it more than once is a no-op.
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable