Allow Preview User to download files without requiring a Guestbook Re…#12548
Allow Preview User to download files without requiring a Guestbook Re…#12548stevenwinship wants to merge 4 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bdf4a83 to
1511464
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
qqmyers
left a comment
There was a problem hiding this comment.
This looks like it would work, except for some minor URL tweaking, but it seems like the fixes are in one-off places rather than the way things are done for other types of users. I made some comments about moving things around and avoiding a new method using signing.
| } else { | ||
| logger.fine("Redirecting to file download url: " + fileDownloadUrl); | ||
| try { | ||
| // Sign URL for preview url user |
There was a problem hiding this comment.
Now that you set the token in the PrivateUrlUser, is there any reason you can't generate the required signed URL in the same method, e.g.
dataverse/src/main/java/edu/harvard/iq/dataverse/api/Access.java
Lines 584 to 608 in 72a5ad2
| @@ -0,0 +1,2 @@ | |||
| ## Bug ## | |||
| Preview Users can now download files without the required guestbook response. | |||
There was a problem hiding this comment.
Preview URL users could not download files from the dataset being previewed if a guestbook was assigned to that dataset. This is now fixed.
| } | ||
| if(!sessionUserCanViewUnpublishedDataset){ | ||
| //Only Reset if user cannot view this Draft Version | ||
| privateUrlUser.setToken(token); |
There was a problem hiding this comment.
Would it be cleaner to set this in
- when the token lookup is done?
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
The guestbook popup does not appear to collect a response before the download attempt is made. Disabling the guestbook on the dataset resolves the issue and files download normally through the Preview URL. This fix reinstates the behavior of the JSF UI from prior versions of Dataverse.
Which issue(s) this PR closes:#12535
Special notes for your reviewer:
Suggestions on how to test this: Create a dataset with a guestbook. Generate a Preview URL. Using the preview url try to download files and dataset zip file. This should work without requiring the guestbook response.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: Included
Additional documentation: