Scope invited members to their assigned workspace(s) - #4
Conversation
Add isPlatformAdmin flag to JWT/session to distinguish platform admins from invited members. Non-admins are restricted to only their assigned workspaces with no access to admin features. - Add isPlatformAdmin to auth JWT/session with case-insensitive email check - Guard Admin mode in ClientProvider (block null client for non-admins) - Conditionally render org switcher, admin menu items, and system status - Hide Clients nav tab for non-admins - Add server-side authorization to clients CRUD API routes - Add admin checks to settings API routes (oauth-apps, memory, model) - Add client-side redirect guard on /dashboard/clients page - Fix members API to resolve names/emails from usersTable (not just accountsTable) - Add unit tests for members API mapping logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
❌ PR Validation Failed Some checks failed. Please review the errors above. |
Code ReviewFound 4 issues that need attention: 1. Missing function:
|
Workflow export JSONs may contain embedded API keys and credentials. Also add *.key to .gitignore for defense in depth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
❌ PR Validation Failed Some checks failed. Please review the errors above. |
- Add email-templates.ts and getResendFromEmail (were unstaged) - Recompute isPlatformAdmin on every JWT refresh (not just initial sign-in) - Add platform admin bypass to POST /api/clients/[id]/members Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
❌ PR Validation Failed Some checks failed. Please review the errors above. |
Reduce minimum duration thresholds (10→5ms, 20→10ms) to account for faster execution on CI runners where setTimeout(10) can resolve in 9ms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
✅ PR Validation Passed All checks passed! Ready for review. |
Summary
isPlatformAdminflag to JWT/session so the client knows if the logged-in user is the platform adminWhat changes for each user type
Security fixes included
POST /api/clients— restricted to platform admin onlyPATCH /api/clients/[id]— requires owner/admin role or platform adminDELETE /api/clients/[id]— requires owner role or platform adminGET /api/settings/oauth-apps— admin-onlyGET /api/settings/memory— admin-onlyGET /api/settings/model— admin-only/dashboard/clientspage — client-side redirect for non-adminsTest plan
npm run typecheck— cleannpm run lint— clean/dashboard/clientsas non-admin → redirected to/dashboardPOST /api/clientsas non-admin → 403 Forbidden🤖 Generated with Claude Code