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

fix: Adjust preview for view-only shares #47831

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Sep 8, 2024

Summary

Previously there was a different behavior for public shares (link-shares) and internal shares, if the user disabled the view permission.
The legacy UI for public shares simply "disabled" the context menu and hided all download actions. With Nextcloud 31 all share types use the consistent permissions attributes, which simplifies code, but caused a regression: Images can no longer been viewed.

Because on 30 and before the attribute was not set, previews for view-only files were still allowed. Now with 31 we need a new way to allow "viewing" shares.

So this is allowing previews for those files, but only for internal usage. This is done by setting a special header, which only works with custom requests, and not by opening the URL directly.

Checklist

@skjnldsv skjnldsv requested review from a team, nfebe, szaimen and sorbaugh and removed request for a team September 16, 2024 09:22
@szaimen szaimen removed their request for review September 16, 2024 10:54
Previously there was a different behavior for public shares (link-shares) and internal shares,
if the user disabled the view permission.
The legacy UI for public shares simply "disabled" the context menu and hided all download actions.
With Nextcloud 31 all share types use the consistent permissions attributes,
which simplifies code, but caused a regression: Images can no longer been viewed.

Because on 30 and before the attribute was not set, previews for view-only files
were still allowed. Now with 31 we need a new way to allow "viewing" shares.

So this is allowing previews for those files, but only for internal usage.
This is done by settin a special header, which only works with custom requests,
and not by opening the URL directly.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux merged commit d4acae6 into master Oct 28, 2024
178 checks passed
@susnux susnux deleted the fix/view-only-preview branch October 28, 2024 18:44
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