public async Task <IActionResult> Get(int id) { var question = await _questionStore.GetQuestionAsync(id); if (question == null) { return(NotFound()); } if (!await _authorizationService.AuthorizeAsync(User, question.Survey, Operations.Update)) { return(new StatusCodeResult((int)HttpStatusCode.Forbidden)); } return(new ObjectResult(DataMapping._questionToDto(question))); }
public async Task <IActionResult> Get(int id) { var question = await _questionStore.GetQuestionAsync(id); if (question == null) { return(NotFound()); } if (!(await _authorizationService.AuthorizeAsync(User, question.Survey, Operations.Update)).Succeeded) { return(StatusCode(403)); } return(Ok(DataMapping._questionToDto(question))); }