From b21e53e5ac481330604e774c4180e95e2bf15163 Mon Sep 17 00:00:00 2001 From: 1161220332 <1161220332@qq.com> Date: Wed, 26 Jun 2024 15:14:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=92=E8=89=B2=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=AA=97=E5=8F=A3=E9=80=BB=E8=BE=91=E3=80=82=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E6=8E=88=E6=9D=83=E7=AA=97=E5=8F=A3=E5=85=B7=E6=9C=89?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=9D=83=E9=99=90=E5=88=86=E9=85=8D=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=8E=9F=E9=80=BB=E8=BE=91=E4=B8=AD=E8=B6=8A?= =?UTF-8?q?=E5=88=86=E9=85=8D=E8=B6=8A=E5=B0=91=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Elight.WinForm/Page/Sys/Role/RoleAuthorizeForm.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Elight.WinForm/Page/Sys/Role/RoleAuthorizeForm.cs b/Elight.WinForm/Page/Sys/Role/RoleAuthorizeForm.cs index fb8622b..64dc656 100644 --- a/Elight.WinForm/Page/Sys/Role/RoleAuthorizeForm.cs +++ b/Elight.WinForm/Page/Sys/Role/RoleAuthorizeForm.cs @@ -69,17 +69,12 @@ namespace Elight.WinForm.Page.Sys.Role try { + //获取该角色的已经分配权限 List listPerIds = roleAuthorizeLogic.GetList(Id).Select(c => c.ModuleId).ToList(); - List listAllPers; - if (new SysUserLogic().ContainsUser("admin", GlobalConfig.CurrentUser.Id)) - { - listAllPers = permissionLogic.GetList(); - } - else - { - listAllPers = permissionLogic.GetList(GlobalConfig.CurrentUser.Id); - } + //获取该角色的所有权限重新分配 + List listAllPers = permissionLogic.GetList(); listAllPers = HandleData(listAllPers); + //通过已分配权限控制是否开放 List result = new List(); foreach (var item in listAllPers) { -- Gitee