mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
954 B
32 lines
954 B
using System.Security.Principal;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.Features;
|
|
using Volo.Abp.Security.Claims;
|
|
|
|
namespace Volo.Abp.FeatureManagement;
|
|
|
|
public class EditionFeatureManagementProvider : FeatureManagementProvider, ITransientDependency
|
|
{
|
|
public override string Name => EditionFeatureValueProvider.ProviderName;
|
|
|
|
protected ICurrentPrincipalAccessor PrincipalAccessor { get; }
|
|
|
|
public EditionFeatureManagementProvider(
|
|
IFeatureManagementStore store,
|
|
ICurrentPrincipalAccessor principalAccessor)
|
|
: base(store)
|
|
{
|
|
PrincipalAccessor = principalAccessor;
|
|
}
|
|
|
|
protected override Task<string> NormalizeProviderKeyAsync(string providerKey)
|
|
{
|
|
if (providerKey != null)
|
|
{
|
|
return Task.FromResult(providerKey);
|
|
}
|
|
|
|
return Task.FromResult(PrincipalAccessor.Principal?.FindEditionId()?.ToString("N"));
|
|
}
|
|
}
|
|
|