public ActionResult UserEdit(int id, string module, bool grant) { PermissionService servie = new PermissionService(); if (module == "SA") { servie.GrantSA(id, grant, SessionManager.UserInfo.UserID); return Json(true, JsonRequestBehavior.AllowGet); } string[] str = module.Split("_".ToCharArray()); int moduleId = Convert.ToInt32(str[1]); Permissions permisson = (Permissions)Enum.Parse(typeof(Permissions), str[0]); bool value = servie.EnsurePermssionForUser(id, moduleId, permisson, grant); return Json(true, JsonRequestBehavior.AllowGet); }