mirror of https://github.com/abpframework/abp.git
committed by
GitHub
11 changed files with 7 additions and 71 deletions
@ -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