fix(list): allow listing an ancestor folder when permission is only on a descendant#299
Merged
Merged
Conversation
…ranted on a descendant A user granted read/write on a deep path (e.g. /folder2/a/b/c) got 403 listing any ancestor folder, including root, since permission was only checked against the exact requested path. Add hasDescendantPermission as a fallback and filter each listed child individually so only folders leading to a permitted descendant (or directly permitted entries) are shown. Also fixes the top-level authorized gate in index.js, which short-circuited before the list route's own check ever ran. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: kptdobe <acapt@adobe.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
auniverseaway
approved these changes
Jul 8, 2026
auniverseaway
left a comment
Member
There was a problem hiding this comment.
Looks good to me. A lot of people are going to be happy about this.
Contributor
|
So IIUC this if you have only permissions in a specific subfolder, this would allow you to navigate to that folder from the root, and you would only see the path to your folder and not anything else. I guess that makes sense 👍 |
adobe-bot
pushed a commit
that referenced
this pull request
Jul 8, 2026
## [1.12.1](v1.12.0...v1.12.1) (2026-07-08) ### Bug Fixes * **list:** allow listing an ancestor folder when permission is only granted on a descendant ([#299](#299)) ([420f664](420f664))
Collaborator
|
🎉 This PR is included in version 1.12.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
3 tasks
kptdobe
added a commit
to adobe/da-live
that referenced
this pull request
Jul 9, 2026
adobe/da-admin#299 lets a folder with no direct grant but a permitted descendant list successfully (filtered), instead of 403. Update the acl_browse test to expect the filtered listing on testdocs, and add a sibling no-permission path (otherdir) to keep true-403 coverage.
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.
Summary
/folder2/a/b/c) got 403 listing any ancestor folder — including root — because permission was checked against the exact requested path only.hasDescendantPermissionas a fallback in the list route: if the exact path isn't directly readable but some descendant is, the listing proceeds, and each child entry is individually checked so only entries that are directly permitted or lead to a permitted descendant are shown.authorizedgate insrc/index.js, which short-circuited with 403 before the list route's own (now descendant-aware) check ever ran, for thelistapi only. All other apis keep the strict exact-path gate.Test plan
npm test— 419 passingnpm run lint— clean/foo/**) and (/foo/+**) grants, prefix-collision guards (/teamvs/teamx), multi-user AND semantics, CONFIG-grant leak prevention, open-ACL passthrough, and regression of existing exact-permission behavior.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com