richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Cannot open PDF shared with another user if download disabled

Open elzody opened this issue 1 year ago • 1 comments

Describe the bug When sharing a PDF to another user with the "Allow download and sync" option unchecked, the other person cannot view the file. It simply shows a blank screen using the files app PDF viewer (files_pdfviewer)

To Reproduce Steps to reproduce the behavior:

  1. Create or upload any PDF document
  2. Share it with another user on the instance
  3. Uncheck the "Allow download and sync" option in the share settings
  4. Try to open the file on the other account

Expected behavior It should display the PDF using Nextcloud Office instead of the files PDF viewer, and ideally no error should occur.

Example

Video

internal-share-disable-download-error.webm

elzody avatar Sep 05 '24 15:09 elzody

Quick update for this: I don't think it's only a richdocuments issue. I tried it with other file types as well, and it always happens with the following message:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
  <s:exception>OCA\DAV\Connector\Sabre\Exception\Forbidden</s:exception>
  <s:message>Access to this shared resource has been denied because its download permission is disabled.</s:message>
  <o:retry xmlns:o="o:">false</o:retry>
  <o:reason xmlns:o="o:">Access to this shared resource has been denied because its download permission is disabled.</o:reason>
</d:error>

And a status code of 403 Forbidden.

elzody avatar Sep 05 '24 16:09 elzody

Nextcloud did a good job in "secure share" and it worked properly to disable user download while giving the right to "view only". However, this same feature is not implemented well for internal share. Would someone fix it since this is a very useful feature for some business users to prevent unauthorized attempt to redistribute documents.

TL1749 avatar Jan 03 '25 07:01 TL1749

Quick update for this: I don't think it's only a richdocuments issue. I tried it with other file types as well, and it always happens with the following message:

DAV should be blocked but the Collabora server should be able to fetch the file content. My guess is that we just need to make sure viewer gets triggered for the file still.

juliusknorr avatar Jan 03 '25 12:01 juliusknorr

The issue is that for PDF files the files_pdfviewer app still takes precedence over richdocuments. I guess we'd need some way that viewer handlers can indicate that they can open without downloading (collabora) so they could be preferred then.

juliusknorr avatar Mar 12 '25 09:03 juliusknorr

This is fixed with https://github.com/nextcloud/files_pdfviewer/pull/1203.

mejo- avatar May 06 '25 16:05 mejo-

Hello Still the same issue on 31.0.5

https://github.com/nextcloud/files_pdfviewer/pull/1203#issuecomment-2875912333

Thanks

asomy23 avatar May 20 '25 05:05 asomy23