예제 #1
0
        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());
        }
예제 #2
0
        public string LoadForUser(int userId)
        {
            var orgs = _app.LoadForUser(userId);

            //添加根节点
            orgs.Add(new Module
            {
                Id        = 0,
                ParentId  = -1,
                Name      = "用户及角色拥有的模块",
                CascadeId = "0"
            });
            return(JsonHelper.Instance.Serialize(orgs));
        }
예제 #3
0
        /// <summary>
        /// 加载特定用户的模块
        /// </summary>
        /// <param name="firstId">The user identifier.</param>
        /// <returns>System.String.</returns>
        public string LoadForUser(string firstId)
        {
            var modules = _app.LoadForUser(firstId);

            return(JsonHelper.Instance.Serialize(modules));
        }
예제 #4
0
        /// <summary>
        /// 加载用户模块
        /// </summary>
        /// <param name="firstId">The user identifier.</param>
        /// <returns>System.String.</returns>
        public string LoadForUser(int firstId)
        {
            var orgs = _app.LoadForUser(firstId);

            return(JsonHelper.Instance.Serialize(orgs));
        }