Namespace Stratara.Abstractions.Multitenancy
Classes
- TenantAccessDeniedException
Thrown by the tenant-isolation pipeline behavior when an ITenantScopedRequest is rejected: either its TenantId does not match the current session's data-owner tenant, or strict mode observed an unauthorized cross-tenant operation.
- TenantMembership
One user's membership in one tenant, carrying the tenant-scoped roles the user holds there. The user↔tenant relationship is many-to-many: a user may hold any number of memberships, each with its own role set, and single-tenant applications are simply the degenerate case of one membership per user.
Interfaces
- ICrossTenantAuthorizer
Authorizes a privileged cross-tenant operation — one where the acting principal's tenant (ActorTenantId) differs from the data-owner tenant (TenantId). Consulted by the tenant-isolation pipeline behavior when it runs in strict mode and observes such a divergence.
- ICurrentUserService
Resolves the current user's id, typically from the ambient ISessionContextProvider.
- ITenantMembershipStore
Persistence contract for user↔tenant memberships (TenantMembership) — the authorization-plane record of which tenants a user belongs to and which tenant-scoped roles the user holds in each.
- ITenantScopedRequest
Opt-in marker for mediator requests (commands or queries) whose payload names the tenant whose data the request operates on. Implement it on a request to subject it to the tenant-isolation pipeline behavior, which rejects the request before the handler runs when TenantId does not match the current session's data-owner tenant.
- ITenantService
Resolves the current Subject (data-owner) tenant id, typically from the ambient ISessionContextProvider.
Enums
- MembershipStatus
Lifecycle state of a TenantMembership.