Skip to content

Commit

Permalink
#11159 fix anon access on published datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Jan 31, 2025
1 parent c66bec1 commit 1baf611
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,7 @@ private String init(boolean initFull) {
setDataverseSiteUrl(systemConfig.getDataverseSiteUrl());

guestbookResponse = new GuestbookResponse();
anonymizedAccess = null;

String sortOrder = getSortOrder();
if(sortOrder != null) {
Expand Down Expand Up @@ -5695,7 +5696,7 @@ public String getPrivateUrlLink(PrivateUrl privateUrl) {

public boolean isAnonymizedAccess() {
if (anonymizedAccess == null) {
if (session.getUser() instanceof PrivateUrlUser) {
if (session.getUser() instanceof PrivateUrlUser && workingVersion.isDraft()) {
anonymizedAccess = ((PrivateUrlUser) session.getUser()).hasAnonymizedAccess();
} else {
anonymizedAccess = false;
Expand Down

0 comments on commit 1baf611

Please sign in to comment.