@@ -5,6 +5,7 @@ import { usePathname } from 'next/navigation'
55import { ORGANIZATION_SETTINGS_GROUPS } from '@/components/settings/navigation'
66import { SettingsSidebar } from '@/components/settings/settings-sidebar'
77import { isApiClientError } from '@/lib/api/client/errors'
8+ import { useSession } from '@/lib/auth/auth-client'
89import { isEnterprise } from '@/lib/billing/plan-helpers'
910import {
1011 hasPaidSubscriptionStatus ,
@@ -30,6 +31,7 @@ export function OrganizationSettingsSidebar(props: OrganizationSettingsSidebarPr
3031 useOrganizationContext ( )
3132 const knowledgeGraphs = useFeatureFlag ( 'mothership-memory-spaces' )
3233 const pathname = usePathname ( )
34+ const { data : session } = useSession ( )
3335 const queryClient = useQueryClient ( )
3436 const refreshPlan = viewer . isAdmin && settingsFeatures . hosted && settingsFeatures . billingEnabled
3537 const { data : summary , error } = useOrganizationBillingSummary ( organization . id , {
@@ -67,11 +69,16 @@ export function OrganizationSettingsSidebar(props: OrganizationSettingsSidebarPr
6769 plane = 'organization'
6870 activeSection = { resolveOrganizationSurfaceSection ( pathname ?? '' ) ?. section ?? 'general' }
6971 groups = { ORGANIZATION_SETTINGS_GROUPS }
70- items = { organizationSurfaceSettingsNavigation ( isAdmin , features , {
71- connectedAccounts : connectedAccountsAvailable ,
72- search : searchAccess . memberScoped ,
73- knowledgeGraphs,
74- } ) }
72+ items = { organizationSurfaceSettingsNavigation (
73+ isAdmin ,
74+ features ,
75+ {
76+ connectedAccounts : connectedAccountsAvailable ,
77+ search : searchAccess . memberScoped ,
78+ knowledgeGraphs,
79+ } ,
80+ session ?. user ?. role === 'admin'
81+ ) }
7582 hrefForSection = { ( section ) => routes . settingsSection ( section ) }
7683 onSectionIntent = { ( section ) =>
7784 warmOrganizationSettingsSectionQuery (
0 commit comments