restrict adding people to admins

This commit is contained in:
Nate Kelley 2025-01-23 11:34:25 -07:00
parent cb96002f04
commit 0a7ffc7980
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 7 additions and 4 deletions

View File

@ -166,7 +166,8 @@ export const AppSidebarPrimary: React.FC<
icon: <AppMaterialIcons icon="add" />,
onClick: () => {
onToggleInviteModal();
}
},
show: isAdmin
},
{
key: 'support',
@ -184,8 +185,8 @@ export const AppSidebarPrimary: React.FC<
onToggleSupportModal();
}
}
];
}, []);
].filter((item) => item.show !== false);
}, [isAdmin]);
return (
<div className="flex w-full flex-col space-y-2.5">

View File

@ -1,6 +1,7 @@
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
import { useCheckIfUserIsAdmin_server } from '@/server_context/user';
import { redirect } from 'next/navigation';
import React from 'react';
export default async function Layout({ children }: { children: React.ReactNode }) {
const isAdmin = await useCheckIfUserIsAdmin_server();

View File

@ -1,5 +1,5 @@
import { BusterRoutes, createBusterRoute } from '@/routes';
import { HeaderContainer } from '../_HeaderContainer';
import { HeaderContainer } from '../../_HeaderContainer';
import { DatasourceForm } from './_DatasourceForm';
export default function Page({

View File

@ -1,6 +1,7 @@
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
import { useCheckIfUserIsAdmin_server } from '@/server_context/user';
import { redirect } from 'next/navigation';
import React from 'react';
export default function Layout({ children }: { children: React.ReactNode }) {
const isAdmin = useCheckIfUserIsAdmin_server();