前端角色权限新增加管理员判断

This commit is contained in:
不做码农 2021-12-19 11:48:13 +08:00
parent ed703e7770
commit 9ae54c1799

View File

@ -52,9 +52,9 @@ namespace ZR.Service.System
/// <returns>菜单权限信息</returns>
public List<string> GetMenuPermission(SysUser user)
{
List<string> perms = new List<string>();
List<string> perms = new();
// 管理员拥有所有权限
if (user.IsAdmin())
if (user.IsAdmin() || GetRolePermission(user).Exists(f => f.Equals(GlobalConstant.AdminRole)))
{
perms.Add(GlobalConstant.AdminPerm);
}