Interface PermissionRegistry
public interface PermissionRegistry
-
Method Summary
Modifier and TypeMethodDescriptiondefault TriStatedeclaredDefault(PermissionNode node, boolean operator) Resolves the declared default for a node, walking itsPermissionNode.lookupChain()so that a declaration onfidorial.command.*applies tofidorial.command.weather.define(PermissionDefinition definition) Declares a permission, replacing any previous declaration for the same node.voiddefineAll(Collection<PermissionDefinition> definitions) Declares several permissions at once, bumpingrevision()only once.definition(PermissionNode node) Looks up a declaration by exact node.longrevision()Monotonic counter bumped on every mutation.booleanundefine(PermissionNode node) Removes a declaration.
-
Method Details
-
define
Declares a permission, replacing any previous declaration for the same node.- Parameters:
definition- the definition- Returns:
- the previous definition, if any
-
defineAll
Declares several permissions at once, bumpingrevision()only once.- Parameters:
definitions- the definitions
-
undefine
Removes a declaration.- Parameters:
node- the node- Returns:
trueif something was removed
-
definition
Looks up a declaration by exact node.- Parameters:
node- the node- Returns:
- the declaration, if any
-
definitions
Collection<PermissionDefinition> definitions()- Returns:
- an immutable snapshot of every declaration
-
declaredDefault
Resolves the declared default for a node, walking itsPermissionNode.lookupChain()so that a declaration onfidorial.command.*applies tofidorial.command.weather.- Parameters:
node- the nodeoperator- whether the holder is an operator- Returns:
- the declared default,
TriState.NOT_SETwhen nothing is declared
-
revision
long revision()Monotonic counter bumped on every mutation. Holders compare it against the value they cached to know whether their resolved permissions are stale.- Returns:
- the current revision
-