示例#1
0
        public async Task <ActionResult> LoadRoleSetRoots()
        {
            var result = await MemberRoleContext.LoadRoleSetRoots(User.Identity.GetUserId());

            ViewBag.AdminMaxPriority = result.adminMaxLevel;
            string roleids = "[";

            foreach (var rid in result.adminRoleIds)
            {
                roleids += (roleids == "[" ? " " : ", ") + rid;
            }
            roleids += " ]";
            ViewBag.AdminRoleIds = roleids;
            return(Json(result));
        }
示例#2
0
        public async Task <ActionResult> RoleAdmin()
        {
            ViewBag.AppName = Startup.App.Name;
            var rrs = await MemberRoleContext.LoadRoleSetRoots(User.Identity.GetUserId());

            ViewBag.AdminMaxPriority = rrs.adminMaxLevel;
            string roleids = "[";

            foreach (var rid in rrs.adminRoleIds)
            {
                roleids += (roleids == "[" ? " " : ", ") + rid;
            }
            roleids += " ]";
            ViewBag.AdminRoleIds = roleids;
            return(View(rrs.roots));
        }