AccessFactContributionStateUtils
Moving between an AccessFactContributionState and the plain values authors write.
Authoring stays cheap -- a resolver may still return true, false, or an observable of boolean?
-- and the boundary names what arrived. What is no longer possible is an unlabelled nil reaching the
merge, where it used to mean two different things depending on where you looked.
Functions
fromValue
AccessFactContributionStateUtils.fromValue(value: boolean?) → string
The state a plain authored value means. nil becomes UNRESOLVED, which is the only reading that was
ever intended -- a source that has not answered yet is saying "I cannot say", not "skip me".
toValue
AccessFactContributionStateUtils.toValue(state: string) → boolean?The boolean a state carries, for the callers that still work in booleans. ALLOW and DENY only; anything else is nil, because neither UNRESOLVED nor ABSTAIN is a yes-or-no.
contributes
AccessFactContributionStateUtils.contributes(state: string) → booleanWhether a layer said anything at all. False only for ABSTAIN -- the merge skips those and asks the next layer down.
isDefinite
AccessFactContributionStateUtils.isDefinite(state: string) → booleanWhether a state is a definite yes or no, as opposed to a non-answer.
invert
AccessFactContributionStateUtils.invert(state: string) → stringThe opposite answer, where there is one.
isContributionState
AccessFactContributionStateUtils.isContributionState(value: any) → boolean