Skip to content

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Dec 7, 2024

Backport of #1077

Same notes from #1097 apply here.

"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 (except for public shares, as in that case the download
permissions are not enforced), 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
as mentioned above download permissions are ignored in public shares 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]>
@danxuliu danxuliu force-pushed the backport/1077/stable28 branch from ddad599 to e7af8b5 Compare January 7, 2025 03:38
@danxuliu
Copy link
Member

danxuliu commented Jan 7, 2025

/compile /

Signed-off-by: nextcloud-command <[email protected]>
@danxuliu danxuliu marked this pull request as ready for review January 7, 2025 03:49
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested

@danxuliu danxuliu merged commit c986b31 into stable28 Jan 8, 2025
40 checks passed
@danxuliu danxuliu deleted the backport/1077/stable28 branch January 8, 2025 19:24
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.

3 participants