withTenantByPass<R> function

Future<R> withTenantByPass<R>({
  1. required Future<R> action(),
})

Allows a DaoTenant to access the db withouth passing in a tenant id. Use this method with CARE.

Use this method to access DaoTenants without constraining the results to a single tenant. It is appropriate to use this for things like cross tenant reporting.

Implementation

Future<R> withTenantByPass<R>({required Future<R> Function() action}) async =>
    (Scope('withTenantByPass')..value<bool>(Tenant._bypassTenantKey, true))
        .run(() async => action());