mirror of https://github.com/abpframework/abp.git
13 changed files with 43 additions and 3 deletions
@ -0,0 +1,24 @@ |
|||||
|
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