From bb682666ad47667fb1d8a78d31b5ba24220ffa85 Mon Sep 17 00:00:00 2001 From: maliming Date: Sun, 16 Aug 2026 12:47:54 +0800 Subject: [PATCH 1/2] Copy the global feature policy to the extension property DTO --- .../CachedObjectExtensionsDtoService.cs | 4 +- .../CachedObjectExtensionsDtoService_Tests.cs | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService_Tests.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs index 097fd899a5..eda9d3818a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs @@ -147,8 +147,8 @@ public class CachedObjectExtensionsDtoService : ICachedObjectExtensionsDtoServic { GlobalFeatures = new ExtensionPropertyGlobalFeaturePolicyDto { - Features = propertyConfig.Policy.Features.Features, - RequiresAll = propertyConfig.Policy.Features.RequiresAll + Features = propertyConfig.Policy.GlobalFeatures.Features, + RequiresAll = propertyConfig.Policy.GlobalFeatures.RequiresAll }, Features = new ExtensionPropertyFeaturePolicyDto { diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService_Tests.cs new file mode 100644 index 0000000000..be70d8c757 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService_Tests.cs @@ -0,0 +1,44 @@ +using Shouldly; +using Volo.Abp.ObjectExtending; +using Volo.Abp.ObjectExtending.Modularity; +using Xunit; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending; + +public class CachedObjectExtensionsDtoService_Tests +{ + private const string ModuleName = "CachedObjectExtensionsDtoServiceTestModule"; + private const string EntityName = "TestEntity"; + + [Fact] + public void Should_Keep_The_Feature_And_Global_Feature_Policies_Apart() + { + ObjectExtensionManager.Instance.Modules() + .ConfigureModule(ModuleName, module => + { + module.ConfigureEntity(EntityName, entity => + { + entity.AddOrUpdateProperty("TestProperty", property => + { + property.Policy.Features.Features = ["TestFeature"]; + property.Policy.Features.RequiresAll = true; + property.Policy.GlobalFeatures.Features = ["TestGlobalFeature"]; + property.Policy.GlobalFeatures.RequiresAll = false; + }); + }); + }); + + var service = new CachedObjectExtensionsDtoService(new ExtensionPropertyAttributeDtoFactory()); + + var policy = service.Get() + .Modules[ModuleName] + .Entities[EntityName] + .Properties["TestProperty"] + .Policy; + + policy.Features.Features.ShouldBe(["TestFeature"]); + policy.Features.RequiresAll.ShouldBeTrue(); + policy.GlobalFeatures.Features.ShouldBe(["TestGlobalFeature"]); + policy.GlobalFeatures.RequiresAll.ShouldBeFalse(); + } +} From 12de0fea4c043cfd5f2e3fffe999bab546fda8b2 Mon Sep 17 00:00:00 2001 From: maliming Date: Sun, 16 Aug 2026 12:49:13 +0800 Subject: [PATCH 2/2] Clear the local settings allow list --- .claude/settings.local.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index d296a49ed4..8b311a3fce 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,11 +1,5 @@ { "permissions": { - "allow": [ - "Bash(yarn nx g:*)", - "Bash(npx vitest:*)", - "Bash(xargs:*)", - "Bash(dotnet build:*)", - "Bash(git show:*)" - ] + "allow": [] } }