diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs index 29de1fc..5ba2940 100644 --- a/SGGL/BLL/Common/CommonService.cs +++ b/SGGL/BLL/Common/CommonService.cs @@ -104,16 +104,16 @@ namespace BLL { /// 启用且末级菜单 var getMenus = from x in db.Sys_Menu - where x.IsUsed == true + where x.IsUsed == true && (x.MenuType == Const.Menu_Server || x.MenuType == Const.Menu_Person || - x.MenuType == Const.Menu_HSSE || x.MenuType==Const.Menu_CQMS || x.MenuType == Const.Menu_HJGL + x.MenuType == Const.Menu_HSSE || x.MenuType == Const.Menu_CQMS || x.MenuType == Const.Menu_HJGL || x.MenuType == Const.Menu_PZHGL) - select x; + select x; List menus = new List(); if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) { menus = getMenus.ToList(); - } + } else { var getUser = UserService.GetUserByUserId(userId); ////用户 @@ -131,7 +131,7 @@ namespace BLL } } #endregion - + #region 根据登陆id菜单id判断是否有权限 /// /// 根据登陆id菜单id判断是否有权限 @@ -163,7 +163,8 @@ namespace BLL { if (!string.IsNullOrEmpty(getUser.RoleId)) { - var power = Funs.DB.Sys_RolePower.FirstOrDefault(x => x.MenuId == menuId && x.RoleId == getUser.RoleId); + List roleIdList = getUser.RoleId.Split(',').ToList(); + var power = Funs.DB.Sys_RolePower.FirstOrDefault(x => x.MenuId == menuId && roleIdList.Contains(x.RoleId)); if (power != null) { returnValue = true; @@ -321,7 +322,7 @@ namespace BLL isPower = false; } } - + return isPower; } #endregion @@ -363,12 +364,12 @@ namespace BLL result = true; } else - { + { var user = BLL.UserService.GetUserByUserId(userId); if (user != null && user.IsOffice == true) { result = true; - } + } } return result; @@ -382,7 +383,7 @@ namespace BLL /// /// /// - public static bool IsHaveSystemPower(string userId,string menuType, string projectId) + public static bool IsHaveSystemPower(string userId, string menuType, string projectId) { using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString)) { @@ -390,7 +391,7 @@ namespace BLL var getUser = db.Sys_User.FirstOrDefault(x => x.UserId == userId); if (getUser != null) { - if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) + if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) { isHave = true; } @@ -480,7 +481,7 @@ namespace BLL } } #endregion - + #region 保存数据 /// /// 保存数据 @@ -669,7 +670,7 @@ namespace BLL public static string GetThisUnitId() { string unitId = Const.UnitId_XJYJ; - + return unitId; } diff --git a/SGGL/FineUIPro.Web/SysManage/RolePower.aspx b/SGGL/FineUIPro.Web/SysManage/RolePower.aspx index 1aec084..538347d 100644 --- a/SGGL/FineUIPro.Web/SysManage/RolePower.aspx +++ b/SGGL/FineUIPro.Web/SysManage/RolePower.aspx @@ -27,10 +27,10 @@ - - - + @@ -55,7 +55,7 @@ -