public withoutPolicy( policy as Type, authorization as PolicyAuthorization ) as PolicyScope:
Opens an authorized lexical scope that omits one mandatory policy.
The authorization service is application-owned. Every successful or denied opening attempt is audited, and repositories retained from the returned scope become unusable as soon as it closes.
| Parameter | Description |
|---|---|
policy | Exact registered policy type to omit. |
authorization | Trusted authorization and audit service. |
Restricted lexical policy scope.
try privileged = manager.withoutPolicy(TenantPolicy.type, authorization): allCustomers = privileged.repository<Customer>().asQuery().toList()