public async Task <IActionResult> GetById([FromQuery] Guid logNoteId) { return(await ProcessAsync(async() => { var logNote = await _logNoteService.GetById(logNoteId); if (await AuthoriseStudent(logNote.StudentId)) { return Ok(logNote); } return Forbid(); }, Permissions.Student.StudentLogNotes.ViewLogNotes)); }
public async Task <IActionResult> GetById([FromQuery] Guid logNoteId) { try { var logNote = await _logNoteService.GetById(logNoteId); var student = await StudentService.GetById(logNote.StudentId); if (await CanAccessPerson(student.PersonId)) { return(Ok(logNote)); } return(Forbid()); } catch (Exception e) { return(HandleException(e)); } }