From 1b4e71ed3a7c4758ef7bfcc30ad6a8c096813a50 Mon Sep 17 00:00:00 2001 From: Haoyk Date: Wed, 19 Apr 2023 13:56:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=92=E8=89=B2=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E6=A0=91=E5=90=91=E4=B8=8B=E7=BA=A7=E8=81=94=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=9A=84UI=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Roles/RolePermissionAppService.cs | 17 ++++++++++------- .../views/admin/roles/PermissionAbpRole.vue | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Roles/RolePermissionAppService.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Roles/RolePermissionAppService.cs index c723bd2b..3b2ab250 100644 --- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Roles/RolePermissionAppService.cs +++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Roles/RolePermissionAppService.cs @@ -60,7 +60,10 @@ namespace Lion.AbpPro.BasicManagement.Roles ? L[$"Permission:SystemManagement"] : group.DisplayName }; - result.Grants.Add(group.Name); + if (group.Permissions.Any(p => p.IsGranted == true && p.Name.StartsWith(group.Name))) + { + result.Grants.Add(group.Name); + } // 获取所有已授权和未授权权限集合 foreach (var item in group.Permissions) { @@ -71,12 +74,12 @@ namespace Lion.AbpPro.BasicManagement.Roles { result.Grants.Add(item.Name); } - else - { - // 只要没有授权的,就移除顶级的分组 - result.Grants.Remove(group.Name); - result.Grants.Remove(item.ParentName); - } + //else + //{ + // // 只要没有授权的,就移除顶级的分组 + // result.Grants.Remove(group.Name); + // result.Grants.Remove(item.ParentName); + //} } // 递归菜单 diff --git a/vben28/src/views/admin/roles/PermissionAbpRole.vue b/vben28/src/views/admin/roles/PermissionAbpRole.vue index c83e0390..bf9ef225 100644 --- a/vben28/src/views/admin/roles/PermissionAbpRole.vue +++ b/vben28/src/views/admin/roles/PermissionAbpRole.vue @@ -1,6 +1,6 @@