File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
apps/sim/app/workspace/[workspaceId]/settings Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 33import dynamic from 'next/dynamic'
44import { useSearchParams } from 'next/navigation'
55import { Skeleton } from '@/components/emcn'
6+ import { useSession } from '@/lib/auth/auth-client'
67import { AdminSkeleton } from '@/app/workspace/[workspaceId]/settings/components/admin/admin-skeleton'
78import { ApiKeysSkeleton } from '@/app/workspace/[workspaceId]/settings/components/api-keys/api-key-skeleton'
89import { BYOKSkeleton } from '@/app/workspace/[workspaceId]/settings/components/byok/byok-skeleton'
@@ -157,9 +158,15 @@ interface SettingsPageProps {
157158export function SettingsPage ( { section } : SettingsPageProps ) {
158159 const searchParams = useSearchParams ( )
159160 const mcpServerId = searchParams . get ( 'mcpServerId' )
161+ const { data : session } = useSession ( )
160162
163+ const isAdminRole = session ?. user ?. role === 'admin'
161164 const effectiveSection =
162- ! isBillingEnabled && ( section === 'subscription' || section === 'team' ) ? 'general' : section
165+ ! isBillingEnabled && ( section === 'subscription' || section === 'team' )
166+ ? 'general'
167+ : section === 'admin' && ! isAdminRole
168+ ? 'general'
169+ : section
163170
164171 const label =
165172 allNavigationItems . find ( ( item ) => item . id === effectiveSection ) ?. label ?? effectiveSection
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export function Admin() {
8383 < Label htmlFor = 'super-user-mode' > Super admin mode</ Label >
8484 < Switch
8585 id = 'super-user-mode'
86- checked = { settings ?. superUserModeEnabled ?? true }
86+ checked = { settings ?. superUserModeEnabled ?? false }
8787 onCheckedChange = { handleSuperUserModeToggle }
8888 />
8989 </ div >
@@ -255,7 +255,10 @@ export function Admin() {
255255 < Button
256256 variant = 'active'
257257 className = 'h-[28px] px-[8px] text-[12px] text-[var(--text-error)]'
258- onClick = { ( ) => setBanUserId ( u . id ) }
258+ onClick = { ( ) => {
259+ setBanUserId ( u . id )
260+ setBanReason ( '' )
261+ } }
259262 disabled = { actionPending && pendingUserId === u . id }
260263 >
261264 Ban
You can’t perform that action at this time.
0 commit comments