Improve Notice (Error) when trying to view a Previous version with non-restricted file
When I tried to "download" a previous version of a file that had been originally unrestricted, and is now restricted, I get the error (makes sense, but would have thought the error would have been in the UI):
{"status":"ERROR","code":403,"message":"'/api/v1/access/datafile/309012' you are not authorized to access this object via this api endpoint. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}
My example: current version of dataset has restricted (just restricted - no request) file: https://demo.dataverse.org/dataset.xhtml?persistentId=doi:10.70122/FK2/GAU2NW
If select "Versions" tab and click on version 2.0 https://demo.dataverse.org/dataset.xhtml?persistentId=doi:10.70122/FK2/GAU2NW&version=2.0
I see the "not restricted" link for this file "Optional Student Spring_2017.ppt" and when click on download get the error in my browser.
Would have expected a popup window, or a "red" in-page warning box.
I think this is the same problem described in this GitHub issue, https://github.com/IQSS/dataverse/issues/3576, where it was proposed that the download button be removed from previous dataset versions.
@jggautier Yes, thanks for pointing that out. I try to search open issues before I create a new one, but it is hard with so many and with so many different takes on the same issue. Thanks.
Agreed, tough to keep track!
@djbrooke asked me to move info from #3576, which references an even older issue, into this issue:
In https://github.com/IQSS/dataverse/issues/4154, @sbarbosadataverse commented on Sep 25, 2017:
I created a new version of a dataset and restricted previously open data files. New version was published. I went back to the archived version and expected to see the data files now restricted, but no lock, red or green, was available (in super user mode or logged out mode).
The download option showed me all available tabular data options and only when I clicked on any of the download options did it show an error. Two ravens was also still available for me to click on and when I did, it redirected to two ravens but no error message and no variables.
The workflow should be that previously open data files (or any files), in archived versions, should not show explore, or download option, and should have the green or red lock to indicate file is restricted.
In https://github.com/IQSS/dataverse/issues/3576, @jggautier commented on Jan 17, 2017:
If previous versions of currently restricted files should not be downloaded, should their download buttons (and Explore-like buttons) be removed (or replaced with a request access button when the current file can only be accessed by request?)
@scolapasta replied on July 26, 2019:
@jggautier yes in previous versions download button should be removed, but we should also note that it had been unrestricted. i.e. just removing the button doesn't give complete info.
Should add that it is not just the Download button. On a previously unrestricted file (version page), the Download URL shows as well. Which does not work, gives same error as clicking the download button.