Class AccessDecision

java.lang.Object
com.ultikits.ultitools.entities.AccessDecision

public final class AccessDecision extends Object
The reason-carrying return type both remote-surface policy predicates change to as of 6.3.0: CommandExecutionManager's command-allowed check and FileOperationManager.isPathAllowed both previously returned boolean. Both managers carry @ApiStatus.Internal, so this signature change is not itself a compatibility event — COMPATIBILITY.md states that @ApiStatus.Internal types are not public API — but it is recorded in COMPATIBILITY.md anyway, because japicmp reads bytecode and does not know @ApiStatus.

Distinguishes a configurable refusal (an operator can flip it — the message names the config key) from a non-configurable one (no configuration changes it — the message says so plainly), per D-17: collapsing the two causes into one sentence sends the operator hunting for a switch that does not exist.

Immutable value type shaped like TriggerContext: private final fields, a private constructor, and named static factories.

Since:
6.3.0
  • Field Details

    • allowed

      private final boolean allowed
    • reason

      private final String reason
    • configurable

      private final boolean configurable
    • configKey

      private final String configKey
  • Constructor Details

    • AccessDecision

      private AccessDecision(boolean allowed, String reason, boolean configurable, String configKey)
  • Method Details

    • allowed

      public static AccessDecision allowed()
      The allowed decision — no reason, no config key.
      Returns:
      an allowed AccessDecision
    • deniedConfigurable

      public static AccessDecision deniedConfigurable(String reason, String configKey)
      A denied decision an operator can flip through configuration.
      Parameters:
      reason - why access was refused
      configKey - the full dotted config path that would flip this refusal — never blank
      Returns:
      a denied, configurable AccessDecision
      Throws:
      IllegalArgumentException - if configKey is null or blank — a configurable refusal naming no key is exactly the silent shape D-17 exists to remove
    • deniedNonConfigurable

      public static AccessDecision deniedNonConfigurable(String reason)
      A denied decision no configuration can lift.
      Parameters:
      reason - why access was refused
      Returns:
      a denied, non-configurable AccessDecision
    • isAllowed

      public boolean isAllowed()
    • getReason

      public String getReason()
    • isConfigurable

      public boolean isConfigurable()
    • getConfigKey

      public String getConfigKey()
    • getMessage

      public String getMessage()
      The human-readable refusal message — empty when allowed. Routes both denied shapes through Capability's two shared refusal statics rather than formatting a sentence of its own — this is what keeps the whole phase to one refusal vocabulary instead of three managers each formatting their own (D-05, D-13, D-17).
      Returns:
      the empty string when allowed; otherwise the refusal sentence