Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(files_sharing): return share tokens to users with matching permissions - #66977

Open
sanketpatel32 wants to merge 1 commit into
nextcloud:masterfrom
sanketpatel32:fix/link-share-token-visibility
Open

sanketpatel32 wants to merge 1 commit into
nextcloud:masterfrom
sanketpatel32:fix/link-share-token-visibility

Conversation

@sanketpatel32

Copy link
Copy Markdown

Summary

Recipients could no longer see or copy public link shares shared with them. formatShare only returned the share token/url when the viewer canEditShare() — i.e. owned the share, initiated it, or reshared an ownerless mount. Everyone else (e.g. members of the group or team a link share targets) got null and could not open or copy the link even though their permissions covered the share's permissions.

This restores the previous behaviour: the token is returned whenever the viewer's permissions on the node cover the share's permissions, regardless of who created the share. The stricter permission check on the node itself (added in #65258) is kept — only the additional canEditShare() gate is removed.

The test expectations changed by #65258 are restored accordingly (dataGetShare, dataFormatShare).

TODO

  • To do: validate on a live Nextcloud instance (recipient views a link share shared with them and sees its URL)
  • To do: contributor to add Signed-off-by trailer before merge

Checklist

  • Tests (unit tests, integration tests, api tests, acceptance tests) are included for all changed or added logic
  • Upcoming releases if applicable
  • Backports requested if applicable

AI (if applicable)

  • The content of this PR was partly or fully generated using AI
  • I confirm that I have disclosed AI use transparently and taken responsibility for the contribution

Assisted by Devin:devin

…sions

Recipients of a share that grants all of the node's permissions (e.g.
members of a group or team a link share targets) were shown the share
without its token and URL, so they could not see or copy the public
link anymore. The additional canEditShare() gate hid the token unless
the viewer owned or initiated the share.

Restore the previous behavior: return the token whenever the viewer's
permissions cover the share's permissions, regardless of who created
the share.

Fixes nextcloud#65935

Assisted-by: Devin:devin
Signed-off-by: Sanket Patel <sanpatel323@gmail.com>
@sanketpatel32
sanketpatel32 force-pushed the fix/link-share-token-visibility branch from 6a1636f to 0befce4 Compare November 24, 2026 16:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Recipients can no longer see or copy existing public link shares (regression from #65258)

1 participant