Skip to main content

Signature

IPolicyRegistry.sol

Description

Returns whether account is authorized under policyId. Never reverts. Unknown or malformed IDs collapse to empty-member-set semantics (ALLOWLISTfalse, BLOCKLISTtrue). Callers that store policy IDs MUST validate policyExists(policyId) at write time.

Invert (NOT) semantics

When bit 63 of policyId is set (the invert flag), isAuthorized resolves the base policy (policyId & ~INVERT_BIT) and returns the opposite of its result:
  • If the base policy does not exist, returns false (fail-closed). A missing or malformed base is never treated as allow-everyone.
  • If the base policy exists, returns !isAuthorized(base, account).
This applies to every policy type: ALLOWLIST, BLOCKLIST, UNION, and INTERSECT. Use invertedPolicyId(policyId) to set or clear bit 63. The inverted ID has no record of its own; members live on the base.

Parameters

Returns

booltrue if account is authorized under policyId, false otherwise.

Access Control

View function. No role or admin restriction.

Policy Interaction

This is part of the singleton PolicyRegistry surface used by B20 policy scopes.

Example

Usage Example