mirror of https://github.com/abpframework/abp
parent
be25d7adbc
commit
ab65edd7f2
@ -1,24 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Volo.Abp.Authorization.Permissions;
|
||||
using Volo.Abp.Features;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
using Volo.Abp.SimpleStateChecking;
|
||||
|
||||
namespace Volo.Abp.SettingManagement;
|
||||
|
||||
public class AllowChangingTimeZoneSettingsFeatureSimpleStateChecker : ISimpleStateChecker<PermissionDefinition>
|
||||
{
|
||||
public async Task<bool> IsEnabledAsync(SimpleStateCheckerContext<PermissionDefinition> context)
|
||||
{
|
||||
var currentTenant = context.ServiceProvider.GetRequiredService<ICurrentTenant>();
|
||||
|
||||
if (!currentTenant.IsAvailable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var featureChecker = context.ServiceProvider.GetRequiredService<IFeatureChecker>();
|
||||
return await featureChecker.IsEnabledAsync(SettingManagementFeatures.EnableTimeZone);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue