From 3000290d863a68c03e9104e23736aef75374c5e7 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 9 Oct 2024 15:08:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(data-protection):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=97=E4=BF=9D=E6=8A=A4=E5=AE=9E=E4=BD=93=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=97=B6=E9=87=8D=E5=A4=8D=E5=86=99=E5=85=A5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationUnitEntityRuleAppService.cs | 5 +++-- .../DataProtectionManagement/RoleEntityRuleAppService.cs | 8 +++++--- .../DataProtectionManagement/ProtectedEntitiesSaver.cs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs index 88f2a6437..ef4d5cab8 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs @@ -36,8 +36,8 @@ public class OrganizationUnitEntityRuleAppService : DataProtectionManagementAppl { throw new BusinessException(DataProtectionManagementErrorCodes.OrganizationUnitEntityRule.DuplicateEntityRule) .WithData(nameof(OrganizationUnitEntityRule.OrgCode), input.OrgCode) - .WithData(nameof(EntityTypeInfo.DisplayName), entityTypeInfo.DisplayName) - .WithData(nameof(EntityRuleBase.Operation), input.Operation); + .WithData(nameof(EntityTypeInfo.Name), entityTypeInfo.Name) + .WithData(nameof(EntityRuleBase.Operation), input.Operation.ToString()); } var entityRule = new OrganizationUnitEntityRule( @@ -78,6 +78,7 @@ public class OrganizationUnitEntityRuleAppService : DataProtectionManagementAppl { entityRule.AllowProperties = allowPropertites; } + entityRule.FilterGroup = input.FilterGroup; entityRule = await _organizationUnitEntityRuleRepository.UpdateAsync(entityRule); diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs index 21a7fedc3..f77ce9ef4 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs @@ -34,10 +34,10 @@ public class RoleEntityRuleAppService : DataProtectionManagementApplicationServi var entityTypeInfo = await _entityTypeInfoRepository.GetAsync(input.EntityTypeId); if (await _roleEntityRuleRepository.FindEntityRuleAsync(input.RoleName, entityTypeInfo.TypeFullName, input.Operation) != null) { - throw new BusinessException(DataProtectionManagementErrorCodes.OrganizationUnitEntityRule.DuplicateEntityRule) + throw new BusinessException(DataProtectionManagementErrorCodes.RoleEntityRule.DuplicateEntityRule) .WithData(nameof(RoleEntityRule.RoleName), input.RoleName) - .WithData(nameof(EntityTypeInfo.DisplayName), entityTypeInfo.DisplayName) - .WithData(nameof(EntityRuleBase.Operation), input.Operation); + .WithData(nameof(EntityTypeInfo.Name), entityTypeInfo.Name) + .WithData(nameof(EntityRuleBase.Operation), input.Operation.ToString()); } var entityRule = new RoleEntityRule( @@ -79,6 +79,8 @@ public class RoleEntityRuleAppService : DataProtectionManagementApplicationServi entityRule.AllowProperties = allowPropertites; } + entityRule.FilterGroup = input.FilterGroup; + entityRule = await _roleEntityRuleRepository.UpdateAsync(entityRule); await CurrentUnitOfWork.SaveChangesAsync(); diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs index b905f4b16..a95b4825c 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs @@ -67,7 +67,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende var newRecords = new List(); var changeRecords = new List(); - var entityTypeList = await EntityTypeInfoRepository.GetListAsync(); + var entityTypeList = await EntityTypeInfoRepository.GetListAsync(includeDetails: true); foreach (var protectedEntityMap in ManagementOptions.ProtectedEntities) { var resourceType = protectedEntityMap.Key;