Ejemplo n.º 1
0
        public JsonResult ChangeAuthRoleNodeButton()
        {
            if (!Utits.IsLogin)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 3;
                sRetrunModel.MessageContent = "用户登录过期,请重新登录后操作.";
                return(Json(sRetrunModel));
            }
            #region 设置角色节点按钮权限
            #region 参数判断
            Guid   roleId  = new Guid(Request["roleId"]);
            string menuIds = Request["menuIds"];

            List <string> menuIdlist = new List <string>();
            if (!string.IsNullOrEmpty(menuIds))
            {
                menuIdlist = menuIds.Split(',').ToList();
            }

            #endregion
            var  authRoleNodeButtonBll = new AuthRoleNodeButtonBll();
            bool isFlag = authRoleNodeButtonBll.UpdateAuthRoleNodeButton(menuIdlist, roleId);
            if (isFlag)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 1;
                sRetrunModel.MessageContent = "操作成功.";
                return(Json(sRetrunModel));
            }
            else
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 0;
                sRetrunModel.MessageContent = "操作失败.";
                return(Json(sRetrunModel));
            }
            #endregion
        }