public ActionResult Setting() { string badge = HttpContext.User.Identity.Name; Right.Entity.RightEntity right = Right.Entity.RightEntity.GetListByProperty(a => a.RightUser, badge).FirstOrDefault(); if (right == null || !(right.RightName.Contains("权限设置") || right.RightName.Contains("值集维护"))) { ViewBag.errorMessage = "对不起,您没有该模块的权限~"; return(View("~/Views/Shared/_Error.cshtml")); } ViewBag.setList = ValueSet.Service.ValueSetService.GetSetList(); ViewBag.rightName = right.RightName; return(View()); }
// 获取单个权限信息 public JsonResult GetRightById(int id) { bool state = true; string msg = string.Empty; Right.Entity.RightEntity entity = null; try { entity = Right.Entity.RightEntity.GetSingle(id); } catch (Exception e) { state = false; msg = e.Message; } return(new JsonResult { Data = new { state = state, msg = msg, data = entity }, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult SaveRight(string dataJson) { bool state = true; string msg = string.Empty; Right.Entity.RightEntity right = null; try { string badge = HttpContext.User.Identity.Name; right = Service.RightService.SaveRight(badge, dataJson, out state, out msg); } catch (Exception e) { state = false; msg = e.Message; } return(new JsonResult { Data = new { state = state, msg = msg, data = right } }); }