Skip to content

fix(acl): seed tree permissions from the path, not the base permission - #5122

Open
bart-doconext wants to merge 1 commit into
nextcloud:masterfrom
bart-doconext:fix/acl-tree-permissions
Open

bart-doconext wants to merge 1 commit into
nextcloud:masterfrom
bart-doconext:fix/acl-tree-permissions

Conversation

@bart-doconext

Copy link
Copy Markdown

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)

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

Used AI to identify the root cause and write the fix and the unit test. I manually reviewed and tested the changes.

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>
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.

Delete Error if advanced permissions ON

1 participant