Пример #1
0
        public ActionResult RenderMenus()
        {
            var roles = UserManager.GetRoles(this.User.Identity.GetUserId()).ToArray();
            //var roles = new string[] { "admin" };
            var menus = _roleMenuService.RenderMenus(roles);

            return(PartialView("_navMenuBar", menus));
        }
Пример #2
0
        public ActionResult RenderMenus()
        {
            var user  = this.UserManager.FindByName(this.User.Identity.Name);
            var roles = UserManager.GetRoles(user.Id);
            //var roles = new string[] { "admin" };
            var menus = _roleMenuService.RenderMenus(roles.ToArray());

            return(PartialView("_navMenuBar", menus));
        }
Пример #3
0
        public async Task <IActionResult> RenderMenus()
        {
            var user = await this.userManager.FindByNameAsync(this.User.Identity.Name);

            var roles = await this.userManager.GetRolesAsync(user);

            //var roles = new string[] { "admin" };
            var menus = _roleMenuService.RenderMenus(roles.ToArray());

            return(PartialView("_navMenuBar", menus));
        }