Class DefaultPermissionsProvider
java.lang.Object
com.github.kaktushose.jda.commands.permissions.DefaultPermissionsProvider
- All Implemented Interfaces:
Implementation.ExtensionProvidable
,PermissionsProvider
Default implementation of PermissionsProvider
with the following behaviour:
hasPermission(User,InvocationContext)
will always returntrue
hasPermission(Member,InvocationContext)
will check against the default Discord permissions. More formally, this method will work with any permission provided byPermission.values()
, ignoring the case. Any other permission String will be ignored.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasPermission
(Member member, InvocationContext<?> context) Checks against the default Discord permissions.boolean
hasPermission
(User user, InvocationContext<?> context) Doesn't perform checks and will always returntrue
.
-
Constructor Details
-
DefaultPermissionsProvider
public DefaultPermissionsProvider()
-
-
Method Details
-
hasPermission
Doesn't perform checks and will always returntrue
.- Specified by:
hasPermission
in interfacePermissionsProvider
- Parameters:
user
- theUser
to perform the check againstcontext
- the correspondingInvocationContext
- Returns:
- always
true
- See Also:
-
hasPermission
Checks against the default Discord permissions.
More formally, this method will work with any permission provided by
Permission.values()
, case-insensitive. Any other permission String will be ignored.- Specified by:
hasPermission
in interfacePermissionsProvider
- Parameters:
member
- theMember
to perform the check againstcontext
- the correspondingInvocationContext
- Returns:
true
if the user has the permission to execute the command
-