Skip to main content
Table of Contents

Class MembershipCrossTenantAuthorizer

Namespace
Stratara.Identity.EntityFrameworkCore
Assembly
Stratara.Identity.EntityFrameworkCore.dll

Membership-backed ICrossTenantAuthorizer for strict tenant isolation: a cross-tenant operation (actor tenant ≠ data-owner tenant) is allowed when the actor holds an active membership in the data-owner tenant, or when the actor holds one of the configured CrossTenantRoles (the operator-impersonation path for platform administrators, who typically hold no membership in the tenants they administer).

public sealed class MembershipCrossTenantAuthorizer : ICrossTenantAuthorizer
Inheritance
MembershipCrossTenantAuthorizer
Implements
Inherited Members
Extension Methods

Remarks

Replaces the framework's deny-all default with stored facts. Register it via AddMembershipCrossTenantAuthorizer(...) alongside AddStrataraTenantIsolation(o => o.Mode = TenantIsolationMode.Strict); without a membership and without a configured role the authorizer stays fail-closed.

Constructors

MembershipCrossTenantAuthorizer(ITenantMembershipStore, IAuthorizationProvider, MembershipCrossTenantAuthorizerOptions)

Membership-backed ICrossTenantAuthorizer for strict tenant isolation: a cross-tenant operation (actor tenant ≠ data-owner tenant) is allowed when the actor holds an active membership in the data-owner tenant, or when the actor holds one of the configured CrossTenantRoles (the operator-impersonation path for platform administrators, who typically hold no membership in the tenants they administer).

public MembershipCrossTenantAuthorizer(ITenantMembershipStore membershipStore, IAuthorizationProvider authorizationProvider, MembershipCrossTenantAuthorizerOptions options)

Parameters

membershipStore ITenantMembershipStore

The membership store consulted for the actor's membership in the data-owner tenant.

authorizationProvider IAuthorizationProvider

The role checker consulted for the configured cross-tenant roles.

options MembershipCrossTenantAuthorizerOptions

The configured cross-tenant roles.

Remarks

Replaces the framework's deny-all default with stored facts. Register it via AddMembershipCrossTenantAuthorizer(...) alongside AddStrataraTenantIsolation(o => o.Mode = TenantIsolationMode.Strict); without a membership and without a configured role the authorizer stays fail-closed.

Methods

IsCrossTenantAllowedAsync(SessionContext, CancellationToken)

Decide whether the current principal may operate across tenants for the given session.

public ValueTask<bool> IsCrossTenantAllowedAsync(SessionContext session, CancellationToken cancellationToken = default)

Parameters

session SessionContext

The ambient session whose actor and data-owner tenants diverge.

cancellationToken CancellationToken

Token to observe while authorizing.

Returns

ValueTask<bool>

true to permit the cross-tenant operation; false to reject it.