public IActionResult View(int id) { if (!_authorizationService.CanUserViewProtocol(UserId, id)) { Unauthorized(); } var model = new ViewProtocolModel(); model.Protocol = _protocolsService.GetProcotolById(id); model.Department = _departmentsService.GetDepartmentById(DepartmentId, false); return(View(model)); }
public async Task <IActionResult> View(int id) { if (!await _authorizationService.CanUserViewProtocolAsync(UserId, id)) { Unauthorized(); } var model = new ViewProtocolModel(); model.Protocol = await _protocolsService.GetProtocolByIdAsync(id); model.Department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId, false); return(View(model)); }