Enum Class Role

java.lang.Object
java.lang.Enum<Role>
dev.dokimos.server.filter.Role
All Implemented Interfaces:
Serializable, Comparable<Role>, Constable

public enum Role extends Enum<Role>
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".
  • Enum Constant Details

    • VIEWER

      public static final Role VIEWER
    • EDITOR

      public static final Role EDITOR
    • ADMIN

      public static final Role ADMIN
  • Method Details

    • values

      public static Role[] 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

      public static Role valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • atLeast

      public boolean atLeast(Role required)
      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