Signature
IPolicyRegistry.sol
Description
Returns whetheraccount is authorized under policyId. Never reverts.
Unknown or malformed IDs collapse to empty-member-set semantics (ALLOWLIST → false, BLOCKLIST → true).
Callers that store policy IDs MUST validate policyExists(policyId) at write time.
Invert (NOT) semantics
When bit 63 ofpolicyId 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).
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
bool — true 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