Interface PermissionContainer
- All Known Subinterfaces:
MutablePermissionTree,PermissionTree
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A generic permission container.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PatternRegex pattern used to validate permission strings. -
Method Summary
Modifier and TypeMethodDescriptionstatic PermissionContainerall()Returns a permission container that always returnsTriState.TRUE.static PermissionContainerempty()Returns an empty permission container.getPermission(String permission) Returns the permission state of the given permission.
-
Field Details
-
PERMISSION_PATTERN
Regex pattern used to validate permission strings.Notes:
Permission strings are composed of a series of nodes separated by dots with alphanumeric characters and minus signs, such as
"plugin.command".
A parent node is always overridden by a child node, such as"plugin.command"overriding"plugin".
Wildcards are also allowed, but they currently have the same effect as a normal node, such as"plugin.command.*"equals"plugin.command".
The only relevant use of wildcards is the root permission"*". It allows you to set a default value for all permissions.
-
-
Method Details
-
empty
Returns an empty permission container. Always returnsTriState.UNDEFINED. -
all
Returns a permission container that always returnsTriState.TRUE. -
getPermission
Returns the permission state of the given permission.- Parameters:
permission- the permission to check- Returns:
- the permission state
-