def intersect

bend-kit-authz@0.1.0.0 · authz.bend:155

import bend-kit-authz@0.1.0.0/authz.bend as Authz
import Base

155# Allow only when both allow. Deny wins over Abstain.
156def intersect(a: Decision, b: Decision) -> Decision:
157  match a:
158    case Deny{}:
159      Deny{}
160    case Allow{}:
161      b
162    case Abstain{}:
163      match b:
164        case Deny{}:
165          Deny{}
166        case Allow{}:
167          Abstain{}
168        case Abstain{}:
169          Abstain{}

Uses (1)

Used by (1)