mirror of https://github.com/buster-so/buster.git
restrict adding people to admins
This commit is contained in:
parent
cb96002f04
commit
0a7ffc7980
|
@ -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">
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue