Browse Source

Add CurrentTenant to claims.

pull/5399/head
Halil İbrahim Kalkan 6 years ago
parent
commit
d396ec9e6c
  1. 1
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj
  2. 4
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentPrincipalAccessor.cs

1
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj

@ -21,6 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.1" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.6" />
</ItemGroup> </ItemGroup>
</Project> </Project>

4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentPrincipalAccessor.cs

@ -42,6 +42,10 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly
{ {
claims.Add(new Claim(AbpClaimTypes.TenantId,configuration.CurrentUser.TenantId.ToString())); claims.Add(new Claim(AbpClaimTypes.TenantId,configuration.CurrentUser.TenantId.ToString()));
} }
else if (configuration.CurrentTenant.Id != null)
{
claims.Add(new Claim(AbpClaimTypes.TenantId,configuration.CurrentTenant.Id.ToString()));
}
foreach (var role in configuration.CurrentUser.Roles) foreach (var role in configuration.CurrentUser.Roles)
{ {

Loading…
Cancel
Save