public IActionResult GetDashboard(string dashboardId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!dashboardRepository.DashboardExists(dashboardId)) { return(NotFound()); } Dashboard dashboard = dashboardRepository.GetDashboard(dashboardId); AuthorizationResult result = authService.AuthorizeAsync(User, dashboard, "DashboardAuthorization").Result; if (!result.Succeeded) { return(Forbid()); } return(Ok(dashboard)); }