Skip to content

Commit

Permalink
Merge pull request #10825 from GlobalDataverseCommunityConsortium/IQS…
Browse files Browse the repository at this point in the history
…S/10824-fix-query-tool-display-on-file-page

IQSS/10824 - Add logic to suppress query tool display for non-public files.
  • Loading branch information
sekmiller authored Sep 10, 2024
2 parents 4143031 + 39a3c8d commit 8f3fc4a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/FilePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,16 @@ private void loadExternalTools() {
exploreTools = exploreTools.stream().filter(tool ->tool.accessesAuxFiles()).collect(Collectors.toList());
queryTools = queryTools.stream().filter(tool ->tool.accessesAuxFiles()).collect(Collectors.toList());
toolsWithPreviews = toolsWithPreviews.stream().filter(tool ->tool.accessesAuxFiles()).collect(Collectors.toList());
} else {
// Don't list queryTools for non-public files
// Note - this logic is not the same as isPubliclyDownloadable which appears to be true for a draft-only file
// It is the same as in the DatasetPage.isShowQueryButton() method
if(file.isRestricted()
|| !file.isReleased()
|| FileUtil.isActivelyEmbargoed(file)
|| FileUtil.isRetentionExpired(file)){
queryTools = new ArrayList<>();
}
}
}

Expand Down

0 comments on commit 8f3fc4a

Please sign in to comment.