Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
            }
        }