private static void AddTenantClaims(TenantUserModel tenantUserModel, ClaimsIdentity identity) { if (tenantUserModel.Tenant == null) { return; } identity.AddClaim(new Claim(UserClaims.TenantId, tenantUserModel.Tenant.Id.ToString())); identity.AddClaim(new Claim(UserClaims.TenantName, tenantUserModel.Tenant.Name)); identity.AddClaim(new Claim(UserClaims.TenantSlug, tenantUserModel.Tenant.Slug)); }
private void AddTenantRoles(TenantUserModel tenantUserModel, ClaimsIdentity identity) { if (tenantUserModel.Roles == null || tenantUserModel.Roles.Count == 0) { return; } foreach (var role in tenantUserModel.Roles) { identity.AddClaim(new Claim(Options.ClaimsIdentity.RoleClaimType, role)); } }