diff --git a/apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx b/apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx index 2a5be5e45c73..1d3da30fb917 100644 --- a/apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx +++ b/apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx @@ -143,6 +143,8 @@ const useFilePermissions = (workingCase: Case, user?: User) => { isDefenceUser(user)), canViewSentToPrisonAdminFiles: isPrisonAdminUser(user) || isPublicProsecutorUser(user), + canViewRulings: + isDistrictCourtUser(user) || isCompletedCase(workingCase.state), }), [user, workingCase.hasCivilClaims], ) @@ -255,7 +257,7 @@ const IndictmentCaseFilesList: FC = ({ onOpenFile={onOpen} /> )} - {(isDistrictCourtUser(user) || isCompletedCase(workingCase.state)) && + {permissions.canViewRulings && filteredFiles.rulings && filteredFiles.rulings.length > 0 && (