Skip to content

Commit 5b3cb72

Browse files
authored
Merge pull request #23120 from abpframework/FeatureAppService
fix: ensure provider policy check before deleting feature
2 parents e8e2530 + b1bc394 commit 5b3cb72

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ protected virtual async Task CheckProviderPolicy(string providerName, string pro
137137

138138
public virtual async Task DeleteAsync([NotNull] string providerName, string providerKey)
139139
{
140+
await CheckProviderPolicy(providerName, providerKey);
140141
await FeatureManager.DeleteAsync(providerName, providerKey);
141142
}
142143
}

modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureManagementApplicationTestModule.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@ namespace Volo.Abp.FeatureManagement;
88
)]
99
public class FeatureManagementApplicationTestModule : AbpModule
1010
{
11-
11+
public override void ConfigureServices(ServiceConfigurationContext context)
12+
{
13+
Configure<FeatureManagementOptions>(options =>
14+
{
15+
options.ProviderPolicies["test"] = FeatureManagementPermissions.ManageHostFeatures;
16+
});
17+
}
1218
}

0 commit comments

Comments
 (0)