Skip to content

Commit

Permalink
Merge pull request #9491 from IQSS/9455-deaccessioned-preview
Browse files Browse the repository at this point in the history
Makes previewers work on files in deaccessioned datasets. #9455
  • Loading branch information
kcondon authored Apr 4, 2023
2 parents 82cef32 + ee1311f commit 97310b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public void explore(GuestbookResponse guestbookResponse, FileMetadata fmd, Exter
ApiToken apiToken = null;
User user = session.getUser();
DatasetVersion version = fmd.getDatasetVersion();
if (version.isDraft() || (fmd.getDataFile().isRestricted()) || (FileUtil.isActivelyEmbargoed(fmd))) {
if (version.isDraft() || fmd.getDatasetVersion().isDeaccessioned() || (fmd.getDataFile().isRestricted()) || (FileUtil.isActivelyEmbargoed(fmd))) {
apiToken = getApiToken(user);
}
DataFile dataFile = null;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/FilePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ public void setSelectedTool(ExternalTool selectedTool) {
public String preview(ExternalTool externalTool) {
ApiToken apiToken = null;
User user = session.getUser();
if (fileMetadata.getDatasetVersion().isDraft() || (fileMetadata.getDataFile().isRestricted()) || (FileUtil.isActivelyEmbargoed(fileMetadata))) {
if (fileMetadata.getDatasetVersion().isDraft() || fileMetadata.getDatasetVersion().isDeaccessioned() || (fileMetadata.getDataFile().isRestricted()) || (FileUtil.isActivelyEmbargoed(fileMetadata))) {
apiToken=fileDownloadService.getApiToken(user);
}
if(externalTool == null){
Expand Down

0 comments on commit 97310b3

Please sign in to comment.