Interface PermissionHolder

All Known Subinterfaces:
CommandCategory, CommandParameter, ExecutableCommand

public interface PermissionHolder
Represents a command component (category, parameter, etc.) that may hold its own permission.
  • Method Details

    • getPermission

      @NotNull @NotNull CommandPermission getPermission()
      Returns the required permission to access this component.

      Note that not all components may be able to explicitly declare permissions, and some permissions will be inherited when appropriate.

      Returns:
      The command permission
    • hasPermission

      default boolean hasPermission(@NotNull @NotNull CommandActor actor)
      Returns whether the given command actor has permission to use this component.
      Parameters:
      actor - Actor to check against
      Returns:
      true if they have the permission, false if otherwise.
    • checkPermission

      default void checkPermission(@NotNull @NotNull CommandActor actor)
      Checks if the given command actor has this permission, otherwise throws a NoPermissionException
      Parameters:
      actor - Actor to check against.