Enum Class Guard.Decision

All Implemented Interfaces:
Serializable, Comparable<Guard.Decision>, Constable
Enclosing interface:

public static enum Guard.Decision extends Enum<Guard.Decision>
The result of a permission evaluation. Provides some more information about *why* an action is allowed or not. Specifically, it allows to determine whether a permission is denied explicitly or implicitly because no rule matched.
  • Enum Constant Details

    • NO_RULE

      public static final Guard.Decision NO_RULE
      No rule matched the permission.

      public static final Guard.Decision DENY_RULE
      The permission was explicitly denied by a rule.

      public static final Guard.Decision GRANT_RULE
      The permission was explicitly granted by a rule.

      public static final Guard.Decision PRIVILEGED
      The permission was granted because we're in privileged mode.
  • Method Details

    • values

      public static Guard.Decision[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Guard.Decision 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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • granted

      public boolean granted()
      Returns true if this evaluation result grants the permission.
      true if the permission is granted.
    • grantable

      public boolean grantable()
      Returns true if combine() may return a decision where granted() returns true.
      true if the final yes/no decision may still be "yes".
    • combine

      public abstract Guard.Decision combine(Guard.Decision that)
      Combines the decision with another decision. This table shows how decisions will be combined:
       | that        | no rule | deny  | grant |
       | **no rule** | no rule | deny  | grant |
       | **deny**    | deny    | deny  | deny  |
       | **grant**   | grant   | deny  | grant |
      that - The decision to combine this decision with.
      The combined decision.