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 returntruehasPermission(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 TypeMethodDescriptionbooleanhasPermission(Member member, InvocationContext<?> context) Checks against the default Discord permissions.booleanhasPermission(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:
hasPermissionin interfacePermissionsProvider- Parameters:
user- theUserto 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:
hasPermissionin interfacePermissionsProvider- Parameters:
member- theMemberto perform the check againstcontext- the correspondingInvocationContext- Returns:
trueif the user has the permission to execute the command
-