Enum Class ControlPlaneRole

java.lang.Object
java.lang.Enum<ControlPlaneRole>
org.mockserver.authentication.authorization.ControlPlaneRole
All Implemented Interfaces:
Serializable, Comparable<ControlPlaneRole>, Constable

public enum ControlPlaneRole extends Enum<ControlPlaneRole>
A coarse control-plane authorization role with a strict hierarchy: ADMINMUTATEREAD. A principal granted a higher role satisfies every requirement at or below it (an ADMIN can do anything a MUTATE or READ principal can; a MUTATE principal can also READ).

The role required by an operation is derived from the read/mutate split used by the control plane (reads require READ; everything else — mutations — requires MUTATE). ADMIN is the ceiling for future finer-grained admin-only operations and currently behaves as a strict superset of MUTATE.

  • Enum Constant Details

  • Method Details

    • values

      public static ControlPlaneRole[] 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 ControlPlaneRole 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
    • satisfies

      public boolean satisfies(ControlPlaneRole required)
      Returns:
      true if a principal granted THIS role is permitted to perform an operation whose required role is required (i.e. this role's rank is at least the required rank). ADMIN.satisfies(READ) is true; READ.satisfies(MUTATE) is false.
    • parse

      public static ControlPlaneRole parse(String value)
      Parses a role name case-insensitively (read / mutate / admin), tolerating surrounding whitespace. Returns null for a blank or unrecognised value so callers can fail closed (an unmappable role grants nothing).