Cannot open PDF shared with another user if download disabled
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:
- Create or upload any PDF document
- Share it with another user on the instance
- Uncheck the "Allow download and sync" option in the share settings
- 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
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.
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.
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.
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.
This is fixed with https://github.com/nextcloud/files_pdfviewer/pull/1203.
Hello Still the same issue on 31.0.5
https://github.com/nextcloud/files_pdfviewer/pull/1203#issuecomment-2875912333
Thanks