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
{{ message }}
Repository navigation
Settings → Agent: non-admin roles see Save / Remove key controls #131
In Settings → Agent, every team member sees the Save input and the Remove key button — including non-admin roles (analyst, manager, agency_partner). The server-side endpoints (PUT/DELETE /api/settings/anthropic-key) correctly gate on profile.role === 'admin' and return 403 for everyone else — but the UI never asks the user's role before rendering the controls, so a non-admin clicking "Save" or "Remove key" just gets a toast error from the 403 response.
This is misleading and feels like a permissions leak even if no key value is ever exposed (GET only returns metadata).
Expected
Non-admin members see the same "key configured" / "no key" status block, read-only.
The new-key input + Save button + Remove key button render only when the caller is an admin.
A small note explains "Only admins can change this key. Ask a team admin if you need it updated."
Scope
web/src/components/settings/agent-section.tsx: conditionally render the input + buttons based on the current user's role. Easiest path is to extend GET /api/settings/anthropic-key to also return caller_is_admin: boolean, and have the component read that flag.
Server endpoints stay as-is (already correctly gated).
Acceptance criteria
Logged in as analyst / manager / agency_partner: the section shows the configured/unconfigured state but no Save / Remove controls; a one-line "Only admins can change this key" note is visible
Logged in as admin: behavior unchanged (Save + Remove available)
No new server-side checks needed beyond what's already in the route
pnpm tsc --noEmit + pnpm format:check clean
Out of scope
Surfacing the same role-gating in other Settings sections (Team is already correctly admin-gated; API Keys is per-user and doesn't need it). Just the Agent section here.
Activity
fix(rbac/ui): gate Settings → Agent Save / Remove controls behind can…