Repository navigation
Require parent permissions to delete or move a resource - #916
Merged
Merged
Conversation
A grant on the resource itself, like a share, no longer allows taking it out of its parent. Reverts the gateway check from opencloud-eu#897.
butonic
approved these changes
Oct 26, 2026
This was referenced Oct 26, 2026
v-scharf
added a commit
that referenced
this pull request
Oct 26, 2026
A DELETE of /Shares/<name> reaches the sharesstorageprovider relative to the share jail root, e.g. './<name>'. Only a reference by share id with the path '.' rejected the share, so this one was forwarded to the owner's storage and deleted the shared resource itself. Since #916 that is denied with 403.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A recipient could delete or move the root of a share they received, which deletes or moves the owner's resource. Decomposedfs only checked Delete or Move on the node itself, and the share grant sits on exactly that node.
#897 blocked this in the gateway, but only for references that address the share root by id alone. A relative path reaches the same node and skips that check, for example:
This PR moves the rule into decomposedfs. Deleting or moving a resource now also requires Delete or Move on its parent:
The gateway check from #897 is reverted. The storage check now covers it, and the gateway check cost a ListReceivedShares call on every delete by id.
Unit tests cover deleting and moving a share root, which is denied, and resources below it, which is allowed.
Follow-up to #897, refs opencloud-eu/opencloud#3770