Class SuperpermsHandler
- All Implemented Interfaces:
IPermissionsHandler
- Direct Known Subclasses:
AbstractVaultHandler
,ConfigPermissionsHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addToGroup
(OfflinePlayer base, String group) boolean
protected boolean
getGroup
(OfflinePlayer base) getGroups
(OfflinePlayer base) boolean
hasPermission
(Player base, String node) Perform a permissions check onbase
.boolean
boolean
isPermissionSet
(Player base, String node) isPermissionSetExact
(Player base, String node) void
registerContext
(String context, Function<User, Iterable<String>> calculator, Supplier<Iterable<String>> suggestions) boolean
removeFromGroup
(OfflinePlayer base, String group) boolean
tryProvider
(Essentials ess) void
-
Constructor Details
-
SuperpermsHandler
public SuperpermsHandler()
-
-
Method Details
-
emulateWildcards
protected boolean emulateWildcards() -
addToGroup
- Specified by:
addToGroup
in interfaceIPermissionsHandler
-
removeFromGroup
- Specified by:
removeFromGroup
in interfaceIPermissionsHandler
-
getGroup
- Specified by:
getGroup
in interfaceIPermissionsHandler
-
getGroups
- Specified by:
getGroups
in interfaceIPermissionsHandler
-
getGroups
- Specified by:
getGroups
in interfaceIPermissionsHandler
-
canBuild
- Specified by:
canBuild
in interfaceIPermissionsHandler
-
inGroup
- Specified by:
inGroup
in interfaceIPermissionsHandler
-
hasPermission
Perform a permissions check onbase
.Unless
emulateWildcards()
is overridden to disable wildcard emulation, wildcard assignments will be checked for permissions. This has a few subtleties in order to respect default-false assignments.Permissible.isPermissionSet(String)
will only return true for permissions that are set on an attachment, or that are a default that evaluates to true. When resolving wildcards, we also want to detect permissions that are not in an attachment, but also won't evaluate to true for operators — since these are ones we've explicitly set tofalse
in theplugin.yml
For the resolution itself, we check whether the permission is either set on the permissible or explicitly not granted to ops (i.e. deviating from the default). If so, the permission's value is returned. Otherwise, the portion of the permission from the beginning to the last occurrence of
.
followed by a*
is taken and the process is repeated.Once a string without dots has been checked, if no result has been found the literal permission
*
is checked and the result of that check is returned.- Specified by:
hasPermission
in interfaceIPermissionsHandler
- Parameters:
base
- Player to check permissions onnode
- permission to check- Returns:
- calculated value
-
isPermissionSet
- Specified by:
isPermissionSet
in interfaceIPermissionsHandler
-
isPermissionSetExact
- Specified by:
isPermissionSetExact
in interfaceIPermissionsHandler
-
getPrefix
- Specified by:
getPrefix
in interfaceIPermissionsHandler
-
getSuffix
- Specified by:
getSuffix
in interfaceIPermissionsHandler
-
registerContext
public void registerContext(String context, Function<User, Iterable<String>> calculator, Supplier<Iterable<String>> suggestions) - Specified by:
registerContext
in interfaceIPermissionsHandler
-
unregisterContexts
public void unregisterContexts()- Specified by:
unregisterContexts
in interfaceIPermissionsHandler
-
getBackendName
- Specified by:
getBackendName
in interfaceIPermissionsHandler
-
tryProvider
- Specified by:
tryProvider
in interfaceIPermissionsHandler
-
getEnabledPermsPlugin
-