You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(content/list-documents): include accessRole/canEdit/canManage on each row
`list-documents` previously returned only document metadata,
leaving the UI to compute 'can I edit this doc?' separately or
optimistically — which led to subtle bugs where viewers saw edit
affordances they couldn't actually use.
The action now joins access-resolution into the listing:
- Owner detection: `ownerEmail === userEmail` AND owner-scope
matches the active orgId (mirrors the `accessFilter` change
in aa93f2f).
- Per-share lookup: a single bulk query against `documentShares`
fetches user + org grants for all returned documents in one
round-trip; `strongerRole()` picks the highest grant per
resource id.
- Visibility floor: org-scoped documents the viewer accesses via
visibility alone get a `viewer` role.
- Final shape adds `accessRole`, `canEdit`, `canManage` so the
sidebar / list UI can render the right affordances directly off
the listing response.
0 commit comments