Feature Request/Idea: ViewUnpublishedDataset should not include file download
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
Overview of the Feature Request
There are two permissions which have undocumented hierarchical relationship: ViewUnpublishedDataset and DownloadFile. The user who has no DownloadFile, but has ViewUnpublishedDataset permission can download files, which is - according to our users* and I agree with them - counter intuitive. I expect that the person who does not have right to download files should not be able to download files.
On code level (https://github.com/IQSS/dataverse/blob/develop/src/main/java/edu/harvard/iq/dataverse/api/Access.java#L1868):
private boolean isAccessAuthorized(User requestUser, DataFile df) {
...
if (!published) { // and restricted or embargoed (implied by earlier processing)
// If the file is not published, they can still download the file, if the user
// has the permission to view unpublished versions:
// This line handles all three authenticated session user, token user, and guest cases.
if (permissionService.requestOn(dvr, df.getOwner()).has(Permission.ViewUnpublishedDataset)) {
// it's not unthinkable, that a GuestUser could be given
// the ViewUnpublished permission!
logger.log(Level.FINE,
"Session-based auth: user {0} has access rights on the non-restricted, unpublished datafile.",
dvr.getUser().getIdentifier());
return true;
}
} else { // published and restricted and/or embargoed
// This line also handles all three authenticated session user, token user, and guest cases.
if (permissionService.requestOn(dvr, df).has(Permission.DownloadFile)) {
return true;
}
}
...
}
There are two suggestions from our users:
- The person who has permission
ViewUnpublishedDatasetcan view the dataset and files metadata only without downloading files. The person who has permissionViewUnpublishedDatasetANDDownloadFilecan download files from unpublished dataset. - The permissions and dependencies among them should be clearly documented. Right now there is nothing about them in the documentation and in the user interface other than their names.
I think that introducing the first suggestion might break existing permissions, so if it would be introduced
- there should be a migration process that would add
DownloadFilepermissions who hasViewUnpublishedDataset - there should be a flag to turn this feature on, so the administrator of the Dataverse service could decide to follow this policy or not
What kind of user is the feature intended for?
(Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)
all
What inspired the request?
Inconsistency in the current behaviour of the software.
What existing behavior do you want changed?
Who can download files of unpublished datasets.
Any brand new behavior do you want to add to Dataverse?
No, but I would like to change who can download files from unpublished datasets.
Any open or closed issues related to this feature request?
Yes, see https://github.com/IQSS/dataverse/issues/4389#issuecomment-578191483
- our users = users of GRO.data: academics of Göttingen Campus, the Max Planck Institutes, and of Lower Saxony academic network in Germany.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/edu/harvard/iq/dataverse/api/Access.java around isAccessAuthorized and review the related discussion in issue #4389. Trace how ViewUnpublishedDataset and DownloadFile are evaluated for unpublished files, then determine the migration and administrator-flag requirements. Done means the chosen policy is implemented without breaking existing permissions and is covered by relevant authorization tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authorization, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100