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
| Parameter | Type |
|---|---|
ctx | { actorId?: string | null; tenantId: string; } |
ctx.actorId? | string | null |
ctx.tenantId | string |
fn | () => T |
Returns
T