public Response <IEnumerable <Module> > LoadForRole(string firstId) { var result = new Response <IEnumerable <Module> > (); try { result.Result = _app.LoadForRole(firstId); } catch (Exception ex) { result.Code = 500; result.Message = ex.InnerException?.Message ?? ex.Message; } return(result); }
public string LoadForRole(int roleId) { var orgs = _app.LoadForRole(roleId); //添加根节点 orgs.Add(new Module { Id = 0, ParentId = -1, Name = "已为角色分配的模块", CascadeId = "0" }); return(JsonHelper.Instance.Serialize(orgs)); }
public ActionResult Assign(Guid firstId, string key) { ViewBag.FirstId = firstId; ViewBag.ModuleType = key; var moduleWithChildren = AuthUtil.GetCurrentUser().ModuleWithChildren; var modules = key == "UserModule" ? _app.LoadForUser(firstId) : _app.LoadForRole(firstId); CheckModule(moduleWithChildren, modules); ViewBag.Modules = BuilderModules(moduleWithChildren); return(View()); }
/// <summary> /// 加载角色模块 /// </summary> /// <param name="firstId">The role identifier.</param> /// <returns>System.String.</returns> public string LoadForRole(string firstId) { var modules = _app.LoadForRole(firstId); return(JsonHelper.Instance.Serialize(modules)); }
/// <summary> /// 加载角色模块 /// </summary> /// <param name="firstId">The role identifier.</param> /// <returns>System.String.</returns> public string LoadForRole(string firstId) { System.Collections.Generic.IEnumerable <Module> modules = _app.LoadForRole(firstId); return(JsonHelper.Instance.Serialize(modules)); }
/// <summary> /// 加载角色模块 /// </summary> /// <param name="firstId">The role identifier.</param> /// <returns>System.String.</returns> public string LoadForRole(int firstId) { var orgs = _app.LoadForRole(firstId); return(JsonHelper.Instance.Serialize(orgs)); }