Interface PermissionHolder
- All Known Subinterfaces:
CommandSender, PermissionStateHolder, Player
public interface PermissionHolder
-
Method Summary
Modifier and TypeMethodDescriptionReturns every override currently applied by active grants, most specific first.default booleanhasPermission(PermissionNode node) Convenience check.default booleanhasPermission(String node) Convenience check from a textual path.voidDrops every cached resolution.booleandefault booleanisPermissionDecided(String node) Tests whether a node has been decided by a grant or a declaration, as opposed to falling through unresolved.Opens a new revocable set of overrides for this holder.Resolves a node against grants, declared defaults and any registeredPermissionResolver.default TriStatepermissionState(String node) Resolves a node from its textual path.voidsetOperator(boolean operator) Sets the operator status of this holder.
-
Method Details
-
isOperator
boolean isOperator()- Returns:
trueif this holder has operator status
-
setOperator
void setOperator(boolean operator) Sets the operator status of this holder.- Parameters:
operator- new status
-
permissionState
Resolves a node against grants, declared defaults and any registeredPermissionResolver.- Parameters:
node- the node- Returns:
- the resolved state
-
permissionState
-
hasPermission
Convenience check. OnlyTriState.TRUEcounts as held, so an unresolved node is treated as refused at the call site while still being distinguishable throughpermissionState(PermissionNode).- Parameters:
node- the node- Returns:
trueif the node resolves toTriState.TRUE
-
hasPermission
Convenience check from a textual path.- Parameters:
node- node path- Returns:
trueif the node resolves toTriState.TRUE
-
isPermissionDecided
Tests whether a node has been decided by a grant or a declaration, as opposed to falling through unresolved.- Parameters:
node- node path- Returns:
trueif the state is notTriState.NOT_SET
-
newGrant
Opens a new revocable set of overrides for this holder.- Parameters:
owner- the plugin requesting the grant- Returns:
- the grant
-
activeOverrides
Map<PermissionNode, TriState> activeOverrides()Returns every override currently applied by active grants, most specific first. Declared defaults are not included; usePermissionRegistry.definitions()for those.- Returns:
- an immutable snapshot of the active overrides
-
invalidatePermissions
void invalidatePermissions()Drops every cached resolution. Called by the server when operator status changes or when the registry is mutated; plugins rarely need it.
-