mirror of https://github.com/abpframework/abp
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.
33 lines
854 B
33 lines
854 B
using System.Threading.Tasks;
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.MultiTenancy;
|
|
|
|
namespace Volo.Abp.FeatureManagement;
|
|
|
|
public class NextTenantFeatureManagementProvider : FeatureManagementProvider, ITransientDependency
|
|
{
|
|
public static string ProviderName => "TENANT";
|
|
|
|
public override string Name => ProviderName;
|
|
|
|
protected ICurrentTenant CurrentTenant { get; }
|
|
|
|
public NextTenantFeatureManagementProvider(
|
|
IFeatureManagementStore store,
|
|
ICurrentTenant currentTenant)
|
|
: base(store)
|
|
{
|
|
CurrentTenant = currentTenant;
|
|
}
|
|
|
|
protected override Task<string> NormalizeProviderKeyAsync(string providerKey)
|
|
{
|
|
if (providerKey != null)
|
|
{
|
|
return Task.FromResult(providerKey);
|
|
}
|
|
|
|
return Task.FromResult(CurrentTenant.Id?.ToString());
|
|
}
|
|
}
|