Repository navigation
Conversation
… there - The windows_computer blocker offers Open Computers to someone who is an admin or the owner of that organization, as their list of organizations says. It switches to the organization first, as Open its settings does. - Someone who isn't an admin there gets no button, since Computers would send them home, and the row keeps no empty actions area. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidmckayv
left a comment
There was a problem hiding this comment.
Visibility is right: only an admin or owner of the machine's organization sees the button, and the guards are unchanged. One real bug, though.
The button sends the admins who need it home. Take someone who is a member of the organization they're working in and an admin of the one holding the machine:
OpenInOrganizationhands the navigation to the switch asleave(delete-account.tsx:263);- the switch runs
leave()beforesetCurrentOrganization(lib/organizations/mutations.ts:58-61); - so
/admin's guard (routes/_authed/admin/route.tsx:21-30) reads the cached current user under the old organization, gets role "member", and redirects to/.
The test misses it because its mocked people/me always answers role: "owner" (app/tests/delete-account.test.tsx:340).
Fix: switch first, then navigate once the switch has finished, so the guard reads the person under the new organization. Add a test where people/me answers per organization: a member where she works, an admin of Acme. The button must land on /admin/computers; today it lands on /.
…s, so Admin's gate reads the person in that organization Computers was opened as the switch's `leave`, which runs before the app changes over, so Admin's gate read the person as they are where they were working and sent somebody who is only a member there home. The page now opens once the switch has finished. Admin's gate moves to lib/auth/admin-gate.ts, and the test's router uses it, with `people/me` answering per organization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed in dfdd304. Open Computers now switches first and opens Computers once the switch has finished, so Admin's gate reads the person in the computer's organization. Admin's gate moved to |
A follow-up to #2840, from Dave's review: the
windows_computerrow in Delete account says an admin removes or forgets the computer under Computers, and now takes an admin there.App
windows_computerrow, for someone who is an admin or the owner of that organization, read from their list of organizations (or from their own role where OpenBot keeps one organization and lists none). Like Open its settings, it switches to that organization first, then opens/admin/computers./adminsends a non-admin home, so the row keeps its words and no empty actions area, as today.OpenOrganizationSettingsbecomesOpenInOrganization, which takes the page and the label, and serves both rows.No API change, so the server needs nothing.
Tests
app/tests/delete-account.test.tsx: an admin's Open Computers switches to the organization and opens Computers. A member there gets no button and no actions area. That test fails when the role check is dropped.bun run format:check,bun run lint,apptypecheck,delete-account*.test.tsx: pass.Changelog
Windows computers.
🤖 Generated with Claude Code