Skip to content

fix(dav): allow moves within own share when sharing is disabled - #66016

Open
susnux wants to merge 2 commits into
masterfrom
fix/65433/move-within-share-sharing-disabled
Open

susnux wants to merge 2 commits into
masterfrom
fix/65433/move-within-share-sharing-disabled

Conversation

@susnux

@susnux susnux commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When sharing is disabled we still should be able to move files within the same share.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

When sharing is disabled for a user, their home storage loses the share
permission, so validateMoveOrCopy() refuses to move or copy any of their
files into a folder that has a shared ancestor, even when source and
target are covered by the same share and no new recipient gains access.

The new unit and integration tests for moves within such a share fail
until this is fixed. Tests for moves that do expose the file to new
recipients (a share not covering the source, a reshare by a recipient,
a received share) document the behavior that has to be kept.

Refs: #65433

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
When sharing is disabled for a user, the sharing_mask wrapper strips the
share permission from their home storage. validateMoveOrCopy() then
refused every move or copy of their files into a folder with a shared
ancestor, even when source and target are below the same share.

Handle sources on the user's home storage like share-ownerless mounts:
only refuse the operation when it exposes the node to new recipients.
Look up shares including reshares, so shares created by recipients on
subfolders of the user's own share are still taken into account.

Fixes: #65433

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux added this to the Nextcloud 36 milestone Oct 29, 2026
@susnux susnux added the bug label Oct 29, 2026
@susnux
susnux requested a review from a team as a code owner October 29, 2026 16:44
@susnux susnux added 3. to review Waiting for reviews feature: sharing labels Oct 29, 2026
@susnux
susnux requested review from come-nc, icewind1991, salmart-dev and sorbaugh and removed request for a team October 29, 2026 16:44
@susnux
susnux requested review from GhassenKefi and provokateurin and removed request for salmart-dev and sorbaugh October 29, 2026 16:45

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Users with sharing disabled cannot move files within a folder they shared

2 participants