Repository navigation
Description
Screen.Recording.2026-09-25.at.12.07.06.PM.mov
Problem Statement
The Content Drive folder tree (left sidebar) hides folders from non-admin users who have READ on them. The same folders appear for the same user in the classic Site Browser. Users with the CMS Administrator role are not affected. The missing folders come back as soon as something checks them one at a time, so the symptom looks intermittent, and it hits every non-admin user at once.
The endpoint response is already missing the folders; the front end is not involved.
Cause. Since #36638 the tree loads each level from GET /api/v1/folder/search. FolderAPIImpl.searchFolders filters READ with the batch overload PermissionAPI.filterCollection(Collection, int, User, boolean) (FolderAPIImpl.java#L818), which resolves permissions through PermissionBitFactoryImpl.getPermittedIds (PermissionBitAPIImpl.java#L1415-L1461). That query (PermissionBitFactoryImpl.java#L2749-L2762) grants READ in only two ways:
- a
permission_referencerow for the folder, joined to the permissions of the parent it inherits from, or individualpermissions on the folder itself.
permission_reference is a lazily built cache. The per-object path (doesUserHavePermission → loadPermissions) writes a row only after walking up to the parent permissionable (PermissionBitFactoryImpl.java#L1715-L1747, async by default via PERMISSION_REFERENCES_UPDATE_ASYNC), and rows are deleted when permissions change on an ancestor. A folder that inherits its permissions and has no row yet matches neither branch and is dropped; the batch path never falls back to the parent walk-up. The Site Browser uses the per-object check, so it is unaffected, and using it back-fills the rows, after which Content Drive shows the folders.
CMS Administrators skip the filter entirely (PermissionBitAPIImpl.java#L1432-L1436), which is why they never see the problem.
Steps to Reproduce
Reproduced on demo.dotcms.com (26.09.24-01) as the stock non-admin backend user Joe Contributor, who has Content Drive access. No permission was changed between steps.
- As the non-admin user, call the endpoint the tree uses for one level:
GET /api/v1/folder/search?siteId=48190c8c-42c4-46af-8d1a-0cd5db894797&path=/application/&recursive=false&orderby=name&direction=ASC&includePermissions=true&page=1&per_page=40
Result: 5 folders. Opening Content Drive and expandingapplicationin the tree shows the same 5:apivtl,containers,templates,themes,vtl. - As the same user, list the same level through the per-object permission check (the deprecated endpoint the tree used before [BUG] Content Drive: Folder tree caps each level at 40 folders (folders beyond 40 are inaccessible) #36638):
POST /api/v1/folder/byPathwith body{"path":"//demo.dotcms.com/application/"}
Result: 7 folders, addingblock-editorandwysiwyg. - Repeat step 1. Result: 7 folders. Reload Content Drive and expand
application: all 7 are shown.
The same happened at the site root: path=/ returned 10 folders, byPath on the root returned 12 (adding events and search), and path=/ then returned 12.
Also observed on an Evergreen Cloud customer instance (build dated 2026-09-02): a recursive folder/search over the whole site returned 61 folders for a non-admin user. After the per-object check ran on each level, the same call returned 90, with all 27 previously missing folders restored.
Not separately verified: a controlled trigger. From the code, any permission change on a site or parent folder should delete the reference rows below it and hide inheriting subfolders from Content Drive until each one is checked individually.
Acceptance Criteria
-
GET /api/v1/folder/searchreturns every folder a non-admin user can READ according toPermissionAPI.doesUserHavePermission, including folders that inherit permissions and have nopermission_referencerow. - Immediately after a permission change on a site or parent folder, a non-admin user sees the same folders in the Content Drive tree as in the Site Browser, without anyone opening the Site Browser first.
- Folders that already have a reference row or individual permissions still resolve in one batch query (no per-folder N+1; see Batch folder permission resolution into a single round-trip per page #36940).
- The EDIT / PUBLISH / EDIT_PERMISSIONS / CAN_ADD_CHILDREN sets built in
resolvePagePermissionsare correct for the same folders. - Other callers of the batch
filterCollection(Collection, int, User, boolean)overload are checked for the same gap. - Integration test: a subfolder inheriting READ from its parent, with no
permission_referencerow, is returned byfolder/searchfor a non-admin user.
dotCMS Version
- Reproduced: 26.09.24-01 (demo.dotcms.com)
- Also observed: Evergreen build dated 2026-09-02
- Present on
mainat 8cf1d5d - Content Drive has used this path since 26.07.27-01, when the tree moved to
folder/search([BUG] Content Drive: Folder tree caps each level at 40 folders (folders beyond 40 are inaccessible) #36638). The batchgetPermittedIdspath came from Issue 36151 implement new site/folder field component edit contentlet #36308 (merged 2026-06-24).
Severity
Medium - Some functionality impacted
Links
- Freshdesk ticket #39531
- Related: [BUG] Content Drive: Folder tree caps each level at 40 folders (folders beyond 40 are inaccessible) #36638 (tree moved to
folder/search), Batch folder permission resolution into a single round-trip per page #36940 (batch permission resolution, performance only), Issue 36151 implement new site/folder field component edit contentlet #36308 (introducedgetPermittedIds) - Related risk: perf(db): UNLOGGED permission_reference and LZ4 compression on variable-length columns #35186 (open) proposes making
permission_referenceUNLOGGED. PostgreSQL empties unlogged tables after crash recovery, which under the current filter would hide every inheriting folder from non-admin users at once.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zJaaal commentedon Sep 30, 2026
It also happens after duplicating a folder in Content Drive (the new bulk folder duplicate, PR #37761), and there it reproduces every time rather than intermittently.
A duplicate is a brand-new folder that inherits its permissions and has none of its own, so it has no
permission_referencerow when the run completes. For a non-admin, the folder search behind the tree drops it until a per-object check writes that row.Reproduced on a scout test environment, as a non-admin backend user with READ and add-children on the parent folder:
GET /api/v1/folder/search. The response leaves out the copy: 4 folders instead of 5.A CMS Administrator never sees it, as described above: the copy appears in the tree at once.
So a fix here also fixes the tree after a duplicate. Nothing needs to change in the duplicate itself: the tree reloads at the right moment, and the endpoint's answer is what's missing the folder.
Comment written by Claude (Claude Code) on behalf of @zJaaal.
github-actions commentedon Oct 16, 2026
PRs linked to this issue
docs(spec): fallback must tell uncached items from denied ones (#37749)
docs(spec): name all four batch-filter callers and narrow AC-003/AC-0…
docs(spec): uncached items get the batch filter's answer; add Liferay…
refactor(permissions): keep the proxy asset resolver as a lazy field,…
zJaaal commentedon Nov 24, 2026
QA Passed
Screen.Recording.2026-11-24.at.10.28.04.AM.mov