public async Task <ActionResult <RedactedCriminalFileDetailResponse> > GetCriminalFileDetailByFileId(string fileId) { var redactedCriminalFileDetailResponse = await _criminalFilesService.FileIdAsync(fileId); if (redactedCriminalFileDetailResponse?.JustinNo == null) { throw new NotFoundException("Couldn't find criminal file with this id."); } return(Ok(redactedCriminalFileDetailResponse)); }
public async Task <ActionResult <RedactedCriminalFileDetailResponse> > GetCriminalFileDetailByFileId(string fileId) { var redactedCriminalFileDetailResponse = await _criminalFilesService.FileIdAsync(fileId); if (redactedCriminalFileDetailResponse?.JustinNo == null) { throw new NotFoundException("Couldn't find criminal file with this id."); } if (User.IsSupremeUser() && redactedCriminalFileDetailResponse.CourtLevelCd != CriminalFileDetailResponseCourtLevelCd.S) { return(Forbid()); } return(Ok(redactedCriminalFileDetailResponse)); }