Administrators never see Shared / Public / Hold chips on their own files #831

Closed
opened 2026-10-01 20:59:05 +00:00 by Cordy · 1 comment
Owner

Found while checking the last #674 point on files-bao (v0.6.314), 2026-10-01.

Steps: as an administrator (nikola-test on files-bao), share a folder in Personal with a person (POST /api/v1/grants, 201; the grant is listed by GET /api/v1/grants?path=…). Open Personal.

Expected: the row carries the "Shared" chip, as it does for everyone else.
Seen: no chip. GET /api/v1/files?path=/home returns the item without shared (or public / hold).

Cause (internal/api/listmeta.go enrichItems): the flags are matched on the item's resolved backend path, and the resolver is taken from h.Store.(resolver). An administrator's store is unscoped, so there is no resolver, resolve stays nil, and applyFlags / applyPublic skip every item. The comment says so ("When the store is not scoped (e.g. an unscoped admin store) enrichment is skipped"), but for an unscoped store the virtual path already IS the backend path, so the right fallback is identity, not "skip". The grant itself is stored correctly (resolveOwned keeps the path as given when there is no resolver).

Fix direction: resolve = identity when the store is not a resolver; test that an unscoped listing gets shared, public and hold. Check search results and Shared-with-me, which go through the same enrichment.

Test data left on files-bao for verification: /home/Quarterly planning documents for the regional offices 2026/, shared read-only with sharer1.

Found while checking the last #674 point on files-bao (v0.6.314), 2026-10-01. **Steps:** as an administrator (nikola-test on files-bao), share a folder in Personal with a person (`POST /api/v1/grants`, 201; the grant is listed by `GET /api/v1/grants?path=…`). Open Personal. **Expected:** the row carries the "Shared" chip, as it does for everyone else. **Seen:** no chip. `GET /api/v1/files?path=/home` returns the item without `shared` (or `public` / `hold`). **Cause (internal/api/listmeta.go `enrichItems`):** the flags are matched on the item's resolved backend path, and the resolver is taken from `h.Store.(resolver)`. An administrator's store is unscoped, so there is no resolver, `resolve` stays nil, and `applyFlags` / `applyPublic` skip every item. The comment says so ("When the store is not scoped (e.g. an unscoped admin store) enrichment is skipped"), but for an unscoped store the virtual path already IS the backend path, so the right fallback is identity, not "skip". The grant itself is stored correctly (`resolveOwned` keeps the path as given when there is no resolver). **Fix direction:** `resolve = identity` when the store is not a resolver; test that an unscoped listing gets `shared`, `public` and `hold`. Check search results and Shared-with-me, which go through the same enrichment. Test data left on files-bao for verification: `/home/Quarterly planning documents for the regional offices 2026/`, shared read-only with sharer1.
Cordy closed this issue 2026-10-01 21:21:16 +00:00
Author
Owner

Fixed in v0.6.315 (PR #832), live on both dogfoods (cairn-enc and cairn-openbao report version=v0.6.315). actrec now forwards Resolve / ReadOnly / Delegated; a reflection test fails the build if scope gains a capability actrec does not forward. The details pane also carries its own surface and inset at every width now.

Open follow-up, not part of this fix: shares created between v0.6.254 and v0.6.314 may be stored with view paths. Cleanup vs. automatic repair is being researched before a decision.

Fixed in v0.6.315 (PR #832), live on both dogfoods (cairn-enc and cairn-openbao report `version=v0.6.315`). actrec now forwards Resolve / ReadOnly / Delegated; a reflection test fails the build if scope gains a capability actrec does not forward. The details pane also carries its own surface and inset at every width now. Open follow-up, not part of this fix: shares created between v0.6.254 and v0.6.314 may be stored with view paths. Cleanup vs. automatic repair is being researched before a decision.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#831
No description provided.