Kaizen
Browse modulesTenancyFunctions

Function: runWithTenant()

function runWithTenant<T>(ctx: {
  actorId?: string | null;
  tenantId: string;
}, fn: () => T): T;

Defined in: server/tenancy/context.ts:50

Run fn with a tenant bound — the normal request path. actorId feeds audit ("who"); it is never used for scoping (the tenant id is the only scope key).

Type Parameters

Type Parameter
T

Parameters

ParameterType
ctx{ actorId?: string | null; tenantId: string; }
ctx.actorId?string | null
ctx.tenantIdstring
fn() => T

Returns

T

On this page