Remove is_admin gate from security agent feature#431
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR cleanly removes the admin gate from the Security Agent feature, making it available to all authenticated users. The changes are consistent and complete:
Files Reviewed (6 files)
|
Make the security agent feature accessible to all users, not just admins: - Remove isAdmin conditional from sidebar nav links (personal + org) - Remove isAdmin gate from Sync button in SecurityFindingsCard - Remove isAdmin prop threading through SecurityAgentPageClient and page components - Clean up unused isAdmin variables in sidebar components
d5772de to
f4f5bf7
Compare
| <div className="flex items-center gap-2"> | ||
| <h1 className="text-3xl font-bold">Security Agent</h1> | ||
| <Badge variant="new">new</Badge> | ||
| <Badge variant="beta">Beta</Badge> |
There was a problem hiding this comment.
For nearly all products (CLI, extension) we moved to the next channel. Does it make sense todo that for the security agent as well?
There was a problem hiding this comment.
Yes I think this makes more sense. Let me update it.
There was a problem hiding this comment.
Actually on second look there's no next in the app yet and we recently added beta to the Autotriage feature. I'm going to keep it consistent for now, but we should discuss this further.
| // Feature flags | ||
| const isAutoTriageFeatureEnabled = useFeatureFlagEnabled('auto-triage-feature'); | ||
| const isDevelopment = process.env.NODE_ENV === 'development'; | ||
| const isAdmin = user?.is_admin || false; |
There was a problem hiding this comment.
I don't really understand. Was the feature only feature flagged on the client side?
There was a problem hiding this comment.
Correct. It never used proper feature flag.
Summary
Remove the
is_admincheck so the security agent feature is accessible to all users, not just admins (@kilocode.aiemails).Changes
isAdminconditional from Security Agent nav links in both personal and organization sidebarsisAdmingate from the Sync button inSecurityFindingsCard, making it available to all usersisAdminprop threading throughSecurityAgentPageClientand both page componentsisAdminvariable declarations in sidebar componentsFiles changed
src/app/(app)/components/PersonalAppSidebar.tsx— RemoveisAdminconditional + unused variablesrc/app/(app)/components/OrganizationAppSidebar.tsx— RemoveisAdminconditional + unused variablesrc/components/security-agent/SecurityFindingsCard.tsx— RemoveisAdminprop and gate on Sync buttonsrc/components/security-agent/SecurityAgentPageClient.tsx— RemoveisAdminprop from type and usagesrc/app/(app)/security-agent/page.tsx— RemoveisAdminprop pass-through and unusedgetUserFromAuthOrRedirectimportsrc/app/(app)/organizations/[id]/security-agent/page.tsx— RemoveisGlobalAdmindestructuring andisAdminprop pass-throughNotes
is_adminchecks were found in the tRPC routers (security-agent-router.ts,organization-security-agent-router.ts) — they usebaseProcedureandorganizationMemberProcedure/organizationOwnerProcedurewhich don't have admin-specific guards.is_adminchecks in the codebase (admin panel, other features) are untouched.Built for jean by Kilo for Slack