Skip to main content

Module tenancy

Module tenancy 

Source
Expand description

Scopes resources to the request tenant.

tenant_id answers the request’s tenant: the signed-in user’s membership unless a server-set Tenant request extension or a Tenant scoped value overrides it, so app middleware and Router::handle tests can set it deliberately. No request header supplies a tenant: learning another tenant’s UUID does not make anyone that tenant.

Structs§

Membership
One tenant a user may act for: its id, and the name the tenant switcher shows. A PanelUser lists its memberships in tenants.
Tenancy
How a resource’s rows belong to a tenant.
Tenant
Request-scoped tenant identifier.
TenantId
One tenant’s id, and the field type of a resource’s tenant column.

Traits§

TenantColumn
A field type a tenancy names: TenantId, or Option<TenantId> for a nullable column.

Functions§

require_tenant
Requires a tenant, returning an error if missing (for tenancy-gated resources).
tenant_id
The tenant the request acts for, if any.