Class ConfigPermissionsHandler
- All Implemented Interfaces:
IPermissionsHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
hasPermission
(Player base, String node) Perform a permissions check onbase
.isPermissionSetExact
(Player base, String node) boolean
tryProvider
(Essentials ess) Methods inherited from class com.earth2me.essentials.perm.impl.SuperpermsHandler
addToGroup, emulateWildcards, getEnabledPermsPlugin, getGroup, getGroups, getGroups, getPrefix, getSuffix, inGroup, isPermissionSet, registerContext, removeFromGroup, unregisterContexts
-
Constructor Details
-
ConfigPermissionsHandler
-
-
Method Details
-
canBuild
- Specified by:
canBuild
in interfaceIPermissionsHandler
- Overrides:
canBuild
in classSuperpermsHandler
-
hasPermission
Description copied from class:SuperpermsHandler
Perform a permissions check onbase
.Unless
SuperpermsHandler.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
- Overrides:
hasPermission
in classSuperpermsHandler
- Parameters:
base
- Player to check permissions onnode
- permission to check- Returns:
- calculated value
-
isPermissionSetExact
- Specified by:
isPermissionSetExact
in interfaceIPermissionsHandler
- Overrides:
isPermissionSetExact
in classSuperpermsHandler
-
getBackendName
- Specified by:
getBackendName
in interfaceIPermissionsHandler
- Overrides:
getBackendName
in classSuperpermsHandler
-
tryProvider
- Specified by:
tryProvider
in interfaceIPermissionsHandler
- Overrides:
tryProvider
in classSuperpermsHandler
-