public async Task <IActionResult> AddRole() { var hasPermission = await _accessManager.HasPermission(User.Identity.Name, _adminSubsystem); if (hasPermission) { var subsystems = _accessManager .GetAllSubsystems() .Select(s => new Option() { Name = s }) .ToList(); var viewModel = new PostRoleViewModel() { SubsystemAccesses = subsystems }; return(View(viewModel)); } return(Forbid(CookieAuthenticationDefaults.AuthenticationScheme)); }