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
PanelUserlists its memberships intenants. - Tenancy
- How a resource’s rows belong to a tenant.
- Tenant
- Request-scoped tenant identifier.
- Tenant
Id - One tenant’s id, and the field type of a resource’s tenant column.
Traits§
- Tenant
Column - A field type a tenancy names:
TenantId, orOption<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.