Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview tab not showing for restricted files even though user has permission to access #8258

Closed
mdmADA opened this issue Nov 29, 2021 · 1 comment · Fixed by #8265
Closed
Milestone

Comments

@mdmADA
Copy link
Contributor

mdmADA commented Nov 29, 2021

What steps does it take to reproduce the issue?

  1. Install and enable a previewer.
  2. Create dataset with one or more restricted files.
  3. Grant permission to a user to one or more restricted file.
  4. User logs in and navigates to the dataset
  5. User sees Preview 'eye' icon in the Files list for the restricted file they have access to
  6. User clicks the 'eye'
  7. the file.xhtml page is rendered for the user
  8. there is no Preview tab
  • When does this issue occur?
    Only for restricted files

  • Which page(s) does it occurs on?
    In every dataset page when a Previewer is enabled.

  • What happens?
    See above ^^^
    It happens because FilePage.java calls FileUtil.isPreviewAllowed() which returns false if the file is restricted (and does not check if the user actually has access). FilePage should call FileDownloadHelper isPreviewAllowed() as that is the method called by all other classes/objects and allows the eye icon to show in the files list in the first place.

  • To whom does it occur (all users, curators, superusers)?
    Anyone who has access through a role.

  • What did you expect to happen?
    The preview tab in the file.xhtml should show.

Which version of Dataverse are you using?
This will occur for every version of dataverse since the file previewers were created. I tested it on demo.dataverse.org v5.8

Any related open or closed issues to this bug report?

Screenshots:

See the Dataverse Users Community conversation with Phil: https://groups.google.com/g/dataverse-community/c/kjhzKAuncSs
for screenshots

@mdmADA
Copy link
Contributor Author

mdmADA commented Nov 29, 2021

Note that I only tested it with SpreadsheetPreviewer but given the restricted file condition returning false in the FileUtil.isPreviewAllowed() method, I expect the issue is across all previewers.

@pdurbin pdurbin added this to the 5.10 milestone Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants