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

[stable29] Show error when trying to open a shared PDF without download permissions #1097

Draft
wants to merge 3 commits into
base: stable29
Choose a base branch
from

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Dec 7, 2024

Backport of #1077

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Remove all the empty commits

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

danxuliu and others added 3 commits December 7, 2024 10:36
"canDownload" inverted the value of the "hideDownload" setting. However,
that was not accurate, as if the download is hidden the file can still
be downloaded. Moreover, it is possible to actually disallow downloads,
which is a different setting (using share attributes) than hiding it.

Therefore, to better differentiate between a hidden download and a
disabled download the previous "canDownload" was renamed (and adjusted
as needed) to "hideDownload".

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
In order to show a PDF file it needs to be downloaded. Therefore, if a
shared PDF file does not have download permissions it is not possible to
show it, so now an error is shown instead.

The error is a custom one rather than a standard error from the viewer
(although with the same appearance) to better explain the reason.

Note that the error is shown only when the PDF file is loaded through
the viewer, which should be always the case. There is a fallback to
inject the UI in public shares in case the viewer is not available, but
handling the error also in that case was not trivial and that fallback
should never be used anyway, so it was not taken into account.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants