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" />,
|
icon: <AppMaterialIcons icon="add" />,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
onToggleInviteModal();
|
onToggleInviteModal();
|
||||||
}
|
},
|
||||||
|
show: isAdmin
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'support',
|
key: 'support',
|
||||||
|
@ -184,8 +185,8 @@ export const AppSidebarPrimary: React.FC<
|
||||||
onToggleSupportModal();
|
onToggleSupportModal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
].filter((item) => item.show !== false);
|
||||||
}, []);
|
}, [isAdmin]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex w-full flex-col space-y-2.5">
|
<div className="flex w-full flex-col space-y-2.5">
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
|
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
|
||||||
import { useCheckIfUserIsAdmin_server } from '@/server_context/user';
|
import { useCheckIfUserIsAdmin_server } from '@/server_context/user';
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export default async function Layout({ children }: { children: React.ReactNode }) {
|
export default async function Layout({ children }: { children: React.ReactNode }) {
|
||||||
const isAdmin = await useCheckIfUserIsAdmin_server();
|
const isAdmin = await useCheckIfUserIsAdmin_server();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { BusterRoutes, createBusterRoute } from '@/routes';
|
import { BusterRoutes, createBusterRoute } from '@/routes';
|
||||||
import { HeaderContainer } from '../_HeaderContainer';
|
import { HeaderContainer } from '../../_HeaderContainer';
|
||||||
import { DatasourceForm } from './_DatasourceForm';
|
import { DatasourceForm } from './_DatasourceForm';
|
||||||
|
|
||||||
export default function Page({
|
export default function Page({
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
|
import { BusterRoutes, createBusterRoute } from '@/routes/busterRoutes';
|
||||||
import { useCheckIfUserIsAdmin_server } from '@/server_context/user';
|
import { useCheckIfUserIsAdmin_server } from '@/server_context/user';
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||||
const isAdmin = useCheckIfUserIsAdmin_server();
|
const isAdmin = useCheckIfUserIsAdmin_server();
|
||||||
|
|
Loading…
Reference in New Issue