Browse Source
Merge pull request #23120 from abpframework/FeatureAppService
fix: ensure provider policy check before deleting feature
pull/23121/head
Halil İbrahim Kalkan
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
8 additions and
1 deletions
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs
-
modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureManagementApplicationTestModule.cs
|
|
@ -137,6 +137,7 @@ public class FeatureAppService : FeatureManagementAppServiceBase, IFeatureAppSer |
|
|
|
|
|
|
|
|
public virtual async Task DeleteAsync([NotNull] string providerName, string providerKey) |
|
|
public virtual async Task DeleteAsync([NotNull] string providerName, string providerKey) |
|
|
{ |
|
|
{ |
|
|
|
|
|
await CheckProviderPolicy(providerName, providerKey); |
|
|
await FeatureManager.DeleteAsync(providerName, providerKey); |
|
|
await FeatureManager.DeleteAsync(providerName, providerKey); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -8,5 +8,11 @@ namespace Volo.Abp.FeatureManagement; |
|
|
)] |
|
|
)] |
|
|
public class FeatureManagementApplicationTestModule : AbpModule |
|
|
public class FeatureManagementApplicationTestModule : AbpModule |
|
|
{ |
|
|
{ |
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
|
|
{ |
|
|
|
|
|
Configure<FeatureManagementOptions>(options => |
|
|
|
|
|
{ |
|
|
|
|
|
options.ProviderPolicies["test"] = FeatureManagementPermissions.ManageHostFeatures; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|