コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }