Public: anyone can read this; the crew can change it.

Access 4b-1: a person sees who can reach what on their own account, at /settings/who-can, linked from settings #18166

opened this

Closed 5h 54m ago

The /settings/who-can page was already on main from #18062 (5ba07c89c), along with its rules, its terminal screen ("Who may do what" in forge tui), its MCP tool and the one shared grant reader. What it lacked was a way in for anyone who isn't an admin. Its only link was on /settings/access, which only admins can see.

Notes

opened this

The /settings/who-can page was already on main from #18062 (5ba07c89c), along with its rules, its terminal screen ("Who may do what" in forge tui), its MCP tool and the one shared grant reader. What it lacked was a way in for anyone who isn't an admin. Its only link was on /settings/access, which only admins can see. The feature doc already said "Settings → Who may do what", but that row did not exist in the sidebar.

What changed

  • src/web/pages/origins.ts: a new Who can reach me row → /settings/who-can in the Account group of the settings sidebar. It shows for every account, admin or not, and adds a "who-can" section so the sidebar highlights it on that page.
  • src/web/pages/who-can.ts: the page now marks its own sidebar row as current, not the admin-only "Access" row.
  • docs/features/who-can.md: names the new sidebar row.
  • test/who-can.test.ts: one new test (#18158). For both bob (a person with no grants) and dave (a person holding one grant of each kind):
    • /settings links to /settings/who-can.
    • Dave's own page lists his grants and the pages where each is changed, with no admin look-up form.
    • Bob's page shows only what his role gives him.

    This test fails without the change. The existing tests already cover one grant of each kind and refuse another person's grants to a non-admin.

Left as it was: the route mark (/settings/who-can is already marked open), the grant reader, and the terminal screen, which already lists the same rows. The commit says No door for that reason. I added no grant table and no admin shortcut.

Checks: bun x tsc --noEmit, the gate, design-lint, and 14 test files passed (172 tests: who-can, grants-view, settings-groups, settings-routes, route-marks-roster, unused-exports, feature-doors, doorless, hollow, unreached, docs-link, origins, design-lint, module-state). I did not run the whole suite; the forge's check runs it on this push.

Try it: sign in as someone who isn't an admin, open /settings, and follow Who can reach me in the sidebar.

[{"go":"/settings","look":"the settings sidebar, Account group","expect":"a 'Who can reach me' row, also for an account that is not an admin"},
 {"go":"/settings/who-can","look":"the page and the sidebar","expect":"'Who can reach me' highlighted; one sentence on what your role gives; your own grants, one row each linking to where it is changed, or 'No grants match.'"}]

🤖 Generated with Claude Code

Closes #18158

5 earlier comments
commented

The /settings/who-can page was already on main from #18062 (5ba07c89c), along with its rules, its terminal screen ("Who may do what" in forge tui), its MCP tool and the one shared grant reader. What it lacked was a way in for anyone who isn't an admin. Its only link was on /settings/access, which only admins can see. The feature doc already said "Settings → Who may do what", but that row did not exist in the sidebar.

What changed

  • src/web/pages/origins.ts: a new Who can reach me row → /settings/who-can in the Account group of the settings sidebar. It shows for every account, admin or not, and adds a "who-can" section so the sidebar highlights it on that page.
  • src/web/pages/who-can.ts: the page now marks its own sidebar row as current, not the admin-only "Access" row.
  • docs/features/who-can.md: names the new sidebar row.
  • test/who-can.test.ts: one new test (#18158). For both bob (a person with no grants) and dave (a person holding one grant of each kind):
    • /settings links to /settings/who-can.
    • Dave's own page lists his grants and the pages where each is changed, with no admin look-up form.
    • Bob's page shows only what his role gives him.

    This test fails without the change. The existing tests already cover one grant of each kind and refuse another person's grants to a non-admin.

Left as it was: the route mark (/settings/who-can is already marked open), the grant reader, and the terminal screen, which already lists the same rows. The commit says No door for that reason. I added no grant table and no admin shortcut.

Checks: bun x tsc --noEmit, the gate, design-lint, and 14 test files passed (172 tests: who-can, grants-view, settings-groups, settings-routes, route-marks-roster, unused-exports, feature-doors, doorless, hollow, unreached, docs-link, origins, design-lint, module-state). I did not run the whole suite; the forge's check runs it on this push.

Try it: sign in as someone who isn't an admin, open /settings, and follow Who can reach me in the sidebar.

[{"go":"/settings","look":"the settings sidebar, Account group","expect":"a 'Who can reach me' row, also for an account that is not an admin"},
 {"go":"/settings/who-can","look":"the page and the sidebar","expect":"'Who can reach me' highlighted; one sentence on what your role gives; your own grants, one row each linking to where it is changed, or 'No grants match.'"}]

🤖 Generated with Claude Code

commented

<!-- look-pages c478255248bb --> Look pages for c478255, from the gate:

  • look pages (named): this pull changes src/web/pages/origins.ts, src/web/pages/who-can.ts; a commit names /settings/grants
commented

Every account's settings sidebar now has a "Who can reach me" link to /settings/who-can. Before, the only link sat in the Access section, which only admins can see, so other people had no way to reach the page. The sidebar row marks the page as current.

The first check run failed for two reasons, both fixed here:

  • Link that ends in a 403: a non-admin's own "member · this forge" grant linked to /settings/people, which only admins can open, and the dead-end test caught it. src/web/pages/who-can.ts now shows a grant as plain text when its link goes to an admin-only settings page and the viewer is not an admin. Admins still get the link. That check uses the admin flag already on the sidebar rows, through the new adminOnlySection in src/web/pages/origins.ts. test/who-can.test.ts checks both the plain text for a member and the link for an admin.
  • Word limit on /settings: the new row's four words put the page over its word limit. docs/design/attention-budget.json raises it from 149 to 153 words, with a note in the same style as the earlier nav-row increases. That is a deliberate budget raise, not a fix to the page; renaming the label shorter would avoid it.

The who-can, attention and dead-end tests now pass, along with the gate, the type check and the design lint.

The terminal side is unchanged because its screen draws no links (stated in the commit's "No door:" line).

To try it: sign in as a non-admin, open /settings and follow "Who can reach me". Your forge-role row shows as text, not a link.

[{"go":"/settings","look":"the Account group in the sidebar","expect":"a 'Who can reach me' row for a non-admin"},{"go":"/settings/who-can","look":"the grant list as a non-admin member","expect":"the 'this forge (forge)' member row is plain text, not a link to /settings/people; the sidebar marks 'Who can reach me' current"},{"go":"/settings/who-can?person=dave","look":"the same row as an admin","expect":"it links to /settings/people"}]

🤖 Generated with Claude Code

commented

This pull now changes nothing: #18131, merged to main in 3ecccb598, already does everything it did, so it can be closed without merging. Merging main in and resolving the conflicts left the branch's files identical to main.

main already has, from #18131:

  • Sidebar link: every account's settings sidebar has a link to /settings/who-can, labelled "Who may do what", marked as the current page when you are on it.
  • Word limit: the /settings word limit is already raised to 153 for that row.
  • Admin-only pages: in a non-admin's view, a grant that only an admin can change is shown as text, "an admin changes it (People)", instead of a link that would return a 403. This covers People, Crew, Cloud, Subscriptions, Secrets, Telemetry and Devices, and both the web page and the terminal.

Every conflict was resolved by taking main's side, which also dropped my adminOnlySection helper because nothing used it any more. bun test test/who-can.test.ts (14 tests), bun x tsc --noEmit and bun scripts/gate.ts pass on the merged branch.

[{"go":"/settings","look":"the Account group in the sidebar as a non-admin","expect":"a 'Who may do what' row linking to /settings/who-can"},{"go":"/settings/who-can","look":"the grant list as a non-admin member","expect":"the forge member row reads 'an admin changes it (People)' with no link to /settings/people"}]

🤖 Generated with Claude Code

commented

Closed by the crew: superseded, its change is already on main in 3ecccb59.

commented

Left #18158 open: 3 unticked items remain (GET /settings/who-can lists the person's own grants, one row per grant with its kind and where it is changed; an account with no grants shows only what its role gives.; Link from /settings. Route marked in src/http/marks/; server-rendered; output escaped.; Reads grants through the existing may()/grant readers; adds no grant table and no admin-only shortcut.).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs