Package com.ultikits.ultitools.entities
Class AccessDecision
java.lang.Object
com.ultikits.ultitools.entities.AccessDecision
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAccessDecision(boolean allowed, String reason, boolean configurable, String configKey) -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessDecisionallowed()The allowed decision — no reason, no config key.static AccessDecisiondeniedConfigurable(String reason, String configKey) A denied decision an operator can flip through configuration.static AccessDecisiondeniedNonConfigurable(String reason) A denied decision no configuration can lift.The human-readable refusal message — empty when allowed.booleanboolean
-
Field Details
-
allowed
private final boolean allowed -
reason
-
configurable
private final boolean configurable -
configKey
-
-
Constructor Details
-
AccessDecision
-
-
Method Details
-
allowed
The allowed decision — no reason, no config key.- Returns:
- an allowed
AccessDecision
-
deniedConfigurable
A denied decision an operator can flip through configuration.- Parameters:
reason- why access was refusedconfigKey- the full dotted config path that would flip this refusal — never blank- Returns:
- a denied, configurable
AccessDecision - Throws:
IllegalArgumentException- ifconfigKeyisnullor blank — a configurable refusal naming no key is exactly the silent shape D-17 exists to remove
-
deniedNonConfigurable
A denied decision no configuration can lift.- Parameters:
reason- why access was refused- Returns:
- a denied, non-configurable
AccessDecision
-
isAllowed
public boolean isAllowed() -
getReason
-
isConfigurable
public boolean isConfigurable() -
getConfigKey
-
getMessage
The human-readable refusal message — empty when allowed. Routes both denied shapes throughCapability'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
-