Exemplo n.º 1
0
        public ActionResult GetPosLevelCheckedTree()
        {
            bool isCheckAll = false;

            isCheckAll = Model_SYS_MENU.HasPermission("Scripts", "SYS_MEMBER_POS3", "List", HttpMethod.Get);
            return(Content(Model_SYS_POSLEVEL_DIC.GetPosLevelCheckedTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE, oc.CurrentUser.SYS_DEPT.PARENT_CODE, isCheckAll)));
        }
Exemplo n.º 2
0
        public ActionResult GetORGMemberIntelligenceCheckedTree()
        {
            bool isCheckAll = false;

            isCheckAll = Model_SYS_MENU.HasPermission("Scripts", "SYS_MEMBER_POS2", "List", HttpMethod.Get);
            return(Content(Model_SYS_MEMBER.GetORGMemberIntelligenceCheckedTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE, oc.CurrentUser.SYS_DEPT.PARENT_CODE, isCheckAll)));
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            string ControllerUrl = "/api/SYS/SYS_DEPT/";
            var    viewModel     = new
            {
                Permission = new//权限
                {
                    a_list    = Model_SYS_MENU.HasPermission("SYS", "SYS_DEPT", "List", Common.HttpMethod.Post),
                    a_add     = Model_SYS_MENU.HasPermission("SYS", "SYS_DEPT", "Add", Common.HttpMethod.Post),
                    a_edit    = Model_SYS_MENU.HasPermission("SYS", "SYS_DEPT", "Edit", Common.HttpMethod.Get),
                    a_del     = Model_SYS_MENU.HasPermission("SYS", "SYS_DEPT", "Del", Common.HttpMethod.Get),
                    a_excelin = oc.CurrentUser.USER_NAME == "sxsh"?true:false
                                //a_excelout = Model_SYS_MENU.HasPermission("SYS", "SYS_DEPT", "List", Common.HttpMethod.Post)
                },
                resx = new
                {
                    listTitle   = "您没有【查看部门】权限",
                    addTitle    = "您没有【新增部门】权限",
                    editTitle   = "您没有【编辑部门】权限!",
                    deleteTitle = "您没有【删除部门】权限!"
                },
                urls = new//请求URL
                {
                    save = ControllerUrl + "Save",
                    list = ControllerUrl + "List",
                    edit = ControllerUrl + "Edit",
                    del  = ControllerUrl + "Del",
                    //writexls = ControllerUrl + "WirteExcel",
                    readxls       = ControllerUrl + "ReadXls",
                    dataGgridName = "data_grid", //列表ID
                    dataGgridType = "treegrid",  //列表类型
                    dataAddName   = "data_add",  //增加窗口
                    //titleName="sss",
                    dataFormName = "DataForm",   //提交表单
                },
                searchForm = new VIEW_SYS_DEPT() //查询
                {
                },
                addForm = new VIEW_SYS_DEPT()
                {                                                                                                                   //添加修改
                },
                extForm = new                                                                                                       //扩展类
                {
                    extA = Model_SYS_DEPT.GetMyORGNoGQTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE, oc.CurrentUser.SYS_DEPT.PARENT_CODE), //部门列表
                    extB = new List <EasyUIComBoBoxNode>()
                    {
                        new EasyUIComBoBoxNode()
                        {
                            id = "0", text = "单位"
                        }, new EasyUIComBoBoxNode()
                        {
                            id = "1", text = "部门"
                        }
                    }
                }
            };

            return(View(viewModel));
        }
Exemplo n.º 4
0
 public ActionResult Index(string id)
 {
     ViewBag.title = "工务安全防控管理平台";
     #region 判断是否是锦州车辆段
     //bool isJzcld = false;//判断是否是锦州车辆段
     //try
     //{
     //    isJzcld = Convert.ToBoolean(ConfigurationManager.AppSettings["isjzcld"]);
     //}
     //catch (Exception)
     //{
     //}
     //if (isJzcld)
     //{
     //    ViewBag.logo = Model_SYS_MENU.HasPermission("FIVET", "FIVET_INFO", "List", HttpMethod.Post) ? "5t" : "jy";//锦州车辆段专用,为解决同一个段不同LOGO;
     //    ViewBag.title = "智慧锦辆铁路安全防控管理平台";
     //}
     #endregion
     ViewBag.warntab = "";//2017-02-15增加
     if (Model_SYS_MENU.HasPermission("WARN", "JOB", "WARNJOB", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNJOB|";//施工计划报警
     }
     if (Model_SYS_MENU.HasPermission("WARN", "RAIN", "WARNRAIN", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNRAIN|";//出巡报警
     }
     if (Model_SYS_MENU.HasPermission("WARN", "CONFIR", "WARNCONFIR", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNCONFIR|";//确认车报警
     }
     if (Model_SYS_MENU.HasPermission("WARN", "RAIL", "WARNRAIL", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNRAIL|";//断轨报警
     }
     if (Model_SYS_MENU.HasPermission("WARN", "CAR", "WARNCAR", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNCAR|";//汽车超速
     }
     if (Model_SYS_MENU.HasPermission("WARN", "GATE", "WARNGATE", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNGATE|";//门禁报警
     }
     if (Model_SYS_MENU.HasPermission("WARN", "PROTECTEDNET", "WARNPROTECTEDNET", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNPROTECTEDNET|";//护网监控报警
     }
     if (Model_SYS_MENU.HasPermission("WARN", "WATER", "WARNWATER", Common.HttpMethod.Post))
     {
         ViewBag.warntab += "|WARNWATER|";//水位报警
     }
     ViewBag.CurrentUser   = oc.CurrentUser.ZSNAME + "(" + oc.CurrentUser.USER_NAME + ")";
     ViewBag.IsEasyPasWord = id;
     return(View());
 }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            string ControllerUrl = "/api/SYS/SYS_MEMBER/";
            var    viewModel     = new
            {
                Permission = new//权限
                {
                    a_list = Model_SYS_MENU.HasPermission("SYS", "SYS_MEMBER", "List", HttpMethod.Post),
                    a_add  = Model_SYS_MENU.HasPermission("SYS", "SYS_MEMBER", "Add", HttpMethod.Post),
                    a_edit = Model_SYS_MENU.HasPermission("SYS", "SYS_MEMBER", "Edit", HttpMethod.Get),
                    a_del  = Model_SYS_MENU.HasPermission("SYS", "SYS_MEMBER", "Del", HttpMethod.Get),
                    //a_excelin = Model_SYS_MENU.HasPermission("SYS", "SYS_MEMBER", "List", HttpMethod.Post),
                    a_excelout = Model_SYS_MENU.HasPermission("SYS", "SYS_MEMBER", "List", HttpMethod.Post),
                },
                resx = new
                {
                    listTitle   = "您没有【查看人员】权限",
                    addTitle    = "您没有【新增人员】权限",
                    editTitle   = "您没有【编辑人员】权限!",
                    deleteTitle = "您没有【删除人员】权限!",
                },
                urls = new//请求URL
                {
                    save     = ControllerUrl + "Save",
                    list     = ControllerUrl + "List",
                    edit     = ControllerUrl + "Edit",
                    del      = ControllerUrl + "Del",
                    writexls = ControllerUrl + "WirteExcel",
                    //readxls = ControllerUrl + "ReadXls",
                    dataGgridName = "data_grid",   //列表ID
                    dataGgridType = "datagrid",    //列表类型
                    dataAddName   = "data_add",    //增加窗口
                    dataFormName  = "DataForm",    //提交表单
                },
                searchForm = new VIEW_SYS_MEMBER() //查询
                {
                },
                addForm = new VIEW_SYS_MEMBER()
                {                                                                                                                //添加修改
                },
                extForm = new                                                                                                    //扩展类
                {
                    extA = Model_SYS_DEPT.GetMyDEPTTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE, oc.CurrentUser.SYS_DEPT.PARENT_CODE), //部门列表
                    extB = Model_SYS_INTELLIGENCE_DIC.GetIntelligenceDic(),                                                      //资质
                    //extC = Model_SYS_POSLEVEL_DIC.GetPosLevelDic(oc.CurrentUser.SYS_DEPT.DEPT_CODE,oc.CurrentUser.SYS_DEPT.PARENT_CODE),//级别
                    extC = Model_SYS_POSLEVEL_DIC.GetPosLevelDic(),                                                              //级别
                    extE = new List <EasyUIComBoBoxNode>()                                                                       //手机状态
                }
            };

            return(View(viewModel));
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            string ControllerUrl = "/api/SYS/SYS_USER/";
            var    viewModel     = new
            {
                Permission = new//权限
                {
                    a_list = Model_SYS_MENU.HasPermission("SYS", "SYS_USER", "List", Common.HttpMethod.Post),
                    a_add  = Model_SYS_MENU.HasPermission("SYS", "SYS_USER", "Add", Common.HttpMethod.Post),
                    a_edit = Model_SYS_MENU.HasPermission("SYS", "SYS_USER", "Edit", Common.HttpMethod.Get),
                    a_del  = Model_SYS_MENU.HasPermission("SYS", "SYS_USER", "Del", Common.HttpMethod.Get),
                },
                resx = new
                {
                    listTitle   = "您没有【查看用户】权限",
                    addTitle    = "您没有【新增用户】权限",
                    editTitle   = "您没有【编辑用户】权限!",
                    deleteTitle = "您没有【删除用户】权限!"
                },
                urls = new//请求URL
                {
                    save = ControllerUrl + "Save",
                    list = ControllerUrl + "List",
                    edit = ControllerUrl + "Edit",
                    del  = ControllerUrl + "Del",
                    //writexls = ControllerUrl + "writexls",
                    dataGgridName = "data_grid", //列表ID
                    dataGgridType = "datagrid",  //列表类型
                    dataAddName   = "data_add",  //增加窗口
                    dataFormName  = "DataForm",  //提交表单
                },
                searchForm = new VIEW_SYS_USER() //查询
                {
                },
                addForm = new VIEW_SYS_USER()
                {             //添加修改
                },
                extForm = new //扩展类
                {
                    extA = Model_SYS_DEPT.GetMyORGTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE, oc.CurrentUser.SYS_DEPT.PARENT_CODE),
                    extB = oc.BllSession.ISYS_ROLEService.Entities.Select(r => new { ROLE_ID = r.ROLE_ID, NAME = r.NAME }).OrderBy(r => r.ROLE_ID).ToList(),
                    extC = new List <string>(),
                    //extD = Model_SYS_DEPT.GetMyORGTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE, oc.CurrentUser.SYS_DEPT.PARENT_CODE, 1)
                    extD = Model_SYS_DEPT.GetMyORGTree(oc.CurrentUser.SYS_DEPT.DEPT_CODE.Substring(0, 2), "0", 1)
                }
                //,viewSettings = new { }
            };

            return(View(viewModel));
        }
Exemplo n.º 7
0
        public ActionResult Index()
        {
            string ControllerUrl = "/api/SYS/SYS_ROLE/";
            var    viewModel     = new
            {
                Permission = new//权限
                {
                    a_list = Model_SYS_MENU.HasPermission("SYS", "SYS_ROLE", "List", HttpMethod.Post),
                    a_add  = Model_SYS_MENU.HasPermission("SYS", "SYS_ROLE", "Add", HttpMethod.Post),
                    a_edit = Model_SYS_MENU.HasPermission("SYS", "SYS_ROLE", "Edit", HttpMethod.Get),
                    a_del  = Model_SYS_MENU.HasPermission("SYS", "SYS_ROLE", "Del", HttpMethod.Get),
                },
                resx = new
                {
                    listTitle   = "您没有【查看角色】权限",
                    addTitle    = "您没有【新增角色】权限",
                    editTitle   = "您没有【编辑角色】权限!",
                    deleteTitle = "您没有【删除角色】权限!"
                },
                urls = new//请求URL
                {
                    save     = ControllerUrl + "Save",
                    list     = ControllerUrl + "List",
                    edit     = ControllerUrl + "Edit",
                    del      = ControllerUrl + "Del",
                    menuTree = ControllerUrl + "GetMyMenuListTree",
                    //writexls = ControllerUrl + "writexls",
                    dataGgridName = "data_grid", //列表ID
                    dataGgridType = "datagrid",  //列表类型
                    dataAddName   = "data_add",  //增加窗口
                    dataFormName  = "DataForm",  //提交表单
                },
                searchForm = new VIEW_SYS_ROLE() //查询
                {
                },
                addForm = new VIEW_SYS_ROLE()
                {             //添加修改
                },
                extForm = new //扩展类
                {
                    extA = oc.UserMenuPermission.Where(m => m.MENU_LEVEL > 3).Select(u => new { id = u.MENU_ID, text = u.MENU_NAME }).ToList(),
                    extB = new List <string>()
                }
            };

            return(View(viewModel));
        }
Exemplo n.º 8
0
        //
        // 摘要:
        //     在过程请求授权时调用。
        //
        // 参数:
        //   filterContext:
        //     筛选器上下文,它封装有关使用 System.Web.Mvc.AuthorizeAttribute 的信息。
        //
        // 异常:
        //   System.ArgumentNullException:
        //     filterContext 参数为 null。
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            /**
             * 如果请求的区域包含area并且area的名称等于SYSs
             * 那么就进行权限验证
             * */

            if (filterContext.RouteData.DataTokens.Keys.Contains("area") &&
                (filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "sys" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "gate" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "gis" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "job" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "material" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "rule" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "scripts" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "rain" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "tool" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "rail" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "car" ||
                 filterContext.RouteData.DataTokens["area"].ToString().ToLower() == "repair"
                ))
            {
                ///**
                //   * 验证用户是否登录
                //   * */
                if (!Model_SYS_USER.IsLogin())
                { ///如果没有登录那么就跳转到登录页面
                    filterContext.Result = new BaseController().Redirect("/Home/Login?msg=noLogin", filterContext.ActionDescriptor, AjaxStatu.nologin);
                }
                else
                {
                    if (!AuthorizeIs(filterContext.HttpContext))
                    {
                        filterContext.Result = new BaseController().Redirect("/Home/Login?msg=noLogin", filterContext.ActionDescriptor, AjaxStatu.none);
                    }
                    else
                    {
                        /**
                         * Action方法本身及它所属控制器都没有定义Skip特性
                         * 那么就可以进行权限验证
                         * */
                        if (!filterContext.ActionDescriptor.AttributeExists <Common.Attributes.SkipAttribute>(false) &&
                            !filterContext.ActionDescriptor.ControllerDescriptor.IsDefined(typeof(Common.Attributes.SkipAttribute), false))
                        {
                            //验证该登录用户是否有访问该页面的权限
                            string strAreaName       = filterContext.RouteData.DataTokens["area"].ToString().ToLower();
                            string strControllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToLower();
                            string strActionName     = filterContext.ActionDescriptor.ActionName.ToLower();

                            if (strActionName == "index")
                            {
                                string[] url = filterContext.HttpContext.Request.FilePath.Split('/');
                                if (url.Length > 4)
                                {
                                    for (int i = 4; i < url.Length; i++)
                                    {
                                        strActionName = strActionName + "/" + url[i];
                                    }
                                }
                            }

                            string     strHttpMethod = filterContext.HttpContext.Request.HttpMethod;
                            HttpMethod httpMethod    = strHttpMethod.ToLower().Equals("get") ? HttpMethod.Get
                                : strHttpMethod.ToLower().Equals("post") ? HttpMethod.Post : HttpMethod.HEAD;

                            if (!Model_SYS_MENU.HasPermission(strAreaName, strControllerName, strActionName, httpMethod))
                            {
                                filterContext.Result = new BaseController().Redirect("/Home/Login?msg=noPermission", filterContext.ActionDescriptor, AjaxStatu.noperm);
                            }
                            else
                            {
                                if (strActionName.ToLower() == "list" && filterContext.HttpContext.Request["page"] != null && filterContext.HttpContext.Request["rows"] != null)
                                {
                                    string pageIndex = filterContext.HttpContext.Request["page"].ToString();
                                    string pageSize  = filterContext.HttpContext.Request["rows"].ToString();
                                    if (pageIndex == "0" && pageSize == "0")
                                    {
                                        filterContext.Result = ObjToJson.GetToJson(null, 0, true);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }