mirror of https://github.com/abpframework/abp.git
3 changed files with 40 additions and 5 deletions
@ -0,0 +1,25 @@ |
|||
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 AllowTenantsToChangeEmailSettingsFeatureSimpleStateChecker : 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.AllowTenantsToChangeEmailSettings); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue