fix(acl): seed tree permissions from the path, not the base permission - #5122
Open
bart-doconext wants to merge 1 commit into
Open
bart-doconext wants to merge 1 commit into
bart-doconext wants to merge 1 commit into
Conversation
getPermissionsForTree() can only remove permissions while it walks the rules below a path, so its starting value is a ceiling. It started from the folder's base permission, which is 0 when "Do not grant any advanced permissions by default" is set, so canDeleteTree() refused every delete in such a folder, even where a rule grants delete. Start from the permissions resolved for the path itself instead. The callers have already checked those, and a descendant that withholds delete still removes it from the result. Fixes nextcloud#5010 Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Bart Kusters <bart@doconext.com>
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.
Users cannot delete anything in a Team folder that was created with "Do not grant any advanced permissions by default" enabled.
Fixed by adjusting getPermissionsForTree() to start resolving permissions from the path itself instead of starting from the folder's base permission.
Manually tested on NC34 and NC35, and covered by a new unit test.
Fixes #5010
🤖 AI (if applicable)
Used AI to identify the root cause and write the fix and the unit test. I manually reviewed and tested the changes.