klyn.data.EntityManager.withoutPolicy
method
public withoutPolicy(
policy as Type,
authorization as PolicyAuthorization
) as PolicyScope:
Description

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.

Parameters
ParameterDescription
policyExact registered policy type to omit.
authorizationTrusted authorization and audit service.
Returns

Restricted lexical policy scope.

Throws
  • PolicyViolationException when the policy is unknown or access is denied.
Example
try privileged = manager.withoutPolicy(TenantPolicy.type, authorization):
allCustomers = privileged.repository<Customer>().asQuery().toList()