Example #1
0
        public JsonResult ChangeAuthRoleNode()
        {
            if (!Utits.IsLogin)
            {
                var sRetrunModel = new ResultMessage();
                sRetrunModel.ErrorType      = 3;
                sRetrunModel.MessageContent = "用户登录过期,请重新登录后操作.";
                return(Json(sRetrunModel));
            }
            #region 设置角色节点权限
            #region 参数判断
            Guid          roleId     = RequestParameters.PGuid("roleId");
            string        menuIds    = RequestParameters.Pstring("menuIds");
            List <string> menuIdlist = new List <string>();
            if (!string.IsNullOrEmpty(menuIds))
            {
                menuIdlist = menuIds.Split(',').ToList();
            }

            #endregion
            var  authRoleNodeBll = new AuthRoleNodeBll();
            bool isFlag          = authRoleNodeBll.UpdateAuthRoleNode(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
        }