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

Permissions: Web UI does not properly check for Download permission for files #5451

Closed
rpocklin opened this issue Jul 6, 2021 · 1 comment

Comments

@rpocklin
Copy link
Contributor

rpocklin commented Jul 6, 2021

Permission Issue - there is a missing check for the 'D' on files to validate whether the Download option is shown in the File Sidebar.

Steps to reproduce

  1. Remove the ability for a user to download a file extendedAttributes.push({ scope: 'permissions', key: 'download', enabled: false })
  2. Using a new browser window, go to the Web UI and login as the user you modified.
  3. Navigate to a file which the user could previously download.
  4. Highlight the file.
  5. 'Download' option is present in the Sidebar under Actions, yet clicking the download correctly gives a 403 Forbidden error (and will do every time).

image

Expected behaviour

Should not show 'Download' under actions.

Actual behaviour

Show 'Download' under actions.

Recommended Fix

Change this function:

canDownload: function() {
// TODO: as soon as we allow folder downloads as archive we want to return `true` here without exceptions
return !isFolder
},

To this:

    canDownload: function() {
      return !isFolder && this.permissions.indexOf('R') >= 0
    },

I have tested this on our own codebase with success.

See #5452 for a similar related issue for copying of files.

@kulmann
Copy link
Member

kulmann commented Jun 3, 2024

oCIS has an X webdav permission now, which prohibits downloads. Was implemented in web with #10973

@kulmann kulmann closed this as completed Jun 3, 2024
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