Interface AccessManager

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 AccessManager
A manager that provides access validators for different execution contexts.
Since:
1.0
Version:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a manager for which all validators always allow access.
    Creates a manager for which all validators always deny access.
    Creates a manager that issues validators that perform simple group memebership checks (that is, a user has equivalent access to a group if and only if they belong to that group).
    overridable(Group overrideGroup)
    Creates a manager that issues validators that generally perform group membership checks, but also allows a given group to override any permission in the system (that is, users that are members of the given group have equivalent permissions to any other group).
    validator(Mono<Guild> guild, Mono<MessageChannel> channel, User caller)
    Creates an access validator under the context of the given guild, channel, and caller.
  • Method Details

    • validator

      AccessValidator validator(Mono<Guild> guild, Mono<MessageChannel> channel, User caller)
      Creates an access validator under the context of the given guild, channel, and caller.
      Parameters:
      guild - The guild of the current execution.
      channel - The channel of the current execution.
      caller - The caller that invoked the execution.
      Returns:
      The appropriate access validator.
    • alwaysAllow

      @SideEffectFree static AccessManager alwaysAllow()
      Creates a manager for which all validators always allow access. That is, a manager that allows access for any user to any group (effectively disabling group checking).
      Returns:
      The manager.
    • alwaysDeny

      @SideEffectFree static AccessManager alwaysDeny()
      Creates a manager for which all validators always deny access. That is, a manager that denies access for any user to any group (effectively disabling any functionality that requires group membership).
      Returns:
      The manager.
    • basic

      Creates a manager that issues validators that perform simple group memebership checks (that is, a user has equivalent access to a group if and only if they belong to that group).
      Returns:
      The manager.
    • overridable

      @SideEffectFree static AccessManager overridable(Group overrideGroup)
      Creates a manager that issues validators that generally perform group membership checks, but also allows a given group to override any permission in the system (that is, users that are members of the given group have equivalent permissions to any other group).
      Parameters:
      overrideGroup - The group that overrides any permission check.
      Returns:
      The manager.