Package revxrsal.commands.command.trait
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 Summary
Modifier and TypeMethodDescriptiondefault void
checkPermission
(@NotNull CommandActor actor) Checks if the given command actor has this permission, otherwise throws aNoPermissionException
@NotNull CommandPermission
Returns the required permission to access this component.default boolean
hasPermission
(@NotNull CommandActor actor) Returns whether the given command actor has permission to use this component.
-
Method Details
-
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
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
Checks if the given command actor has this permission, otherwise throws aNoPermissionException
- Parameters:
actor
- Actor to check against.
-