/// <summary> /// 获取用户没有权限的功能点列表 /// </summary> /// <param name="UserId">用户编码</param> /// <returns>用户无权限功能列表</returns> public static List <Sys_UserPermission> UserNotPermisionnList(string UserId) { ADOSys_UserPermission PermissionInstance = new ADOSys_UserPermission(); List <Sys_UserPermission> ListPermission = PermissionInstance .GetUserPerimission(UserId).Where(o => (string.IsNullOrEmpty(o.PU_IsCheck) || o.PU_IsCheck != "1") && (!o.PU_FunCode.StartsWith("C"))).ToList(); return(ListPermission); }
/// <summary> /// 用户权限列表 /// </summary> /// <param name="UserId">用户编码</param> /// <returns>用户权限List</returns> public static List <Sys_UserPermission> UserPermissionList(string UserId) { ADOSys_UserPermission PermissionInstance = new ADOSys_UserPermission(); List <Sys_UserPermission> ListPermission = PermissionInstance .GetUserPerimission(UserId).Where(o => o.PU_IsCheck == "1" && (!o.PU_FunCode.StartsWith("C"))).ToList(); return(ListPermission); }
/// <summary> /// 获取用户所拥有的所有权限 /// </summary> /// <param name="usercode"></param> /// <returns></returns> public List <Sys_UserPermission> GetUserPermissionWithRole(string usercode) { //HR_Stuff stuff = sInstance.GetModel(string.Format(" AND Stuff_Code='{0}'",usercode)); var list = instance.GetUserPerimission(usercode); //if (!string.IsNullOrEmpty(stuff.Stuff_Role)) //{ // var list2 = instance.GetUserPerimission(usercode); // var result = list.Union(list2); // return result.Distinct(new CommonEqualityComparer<Sys_UserPermission, string>(o => o.PU_FunCode)).ToList(); //} //else //{ return(list); //} //return GetListByCode(string.Format(" AND PU_UserCode='{0}'",usercode)); }
/// <summary> /// 获取用户相关的权限列表 /// </summary> /// <param name="uid"></param> /// <returns></returns> public List <Sys_UserPermission> GetUserPermissionListByUser(string uid) { List <Sys_UserPermission> list = pInstance.GetUserPerimission(uid); return(list); }