Package dev.dokimos.server.filter
Enum Class Role
- All Implemented Interfaces:
Serializable,Comparable<Role>,Constable
Role granted to an authenticated
Principal. Roles are ordered by privilege: a VIEWER
may only read, an EDITOR may also perform writes, and an ADMIN may additionally manage
API keys. The order is used by atLeast(Role) to express "this role or higher".-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true when this role is at least as privileged as the required role.static RoleReturns the enum constant of this class with the specified name.static Role[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
VIEWER
-
EDITOR
-
ADMIN
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
atLeast
Returns true when this role is at least as privileged as the required role.- Parameters:
required- the minimum role to satisfy- Returns:
- true when this role meets or exceeds
required
-