mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
parent
c90bd941b5
commit
561cde6e7e
20 changed files with 133 additions and 98 deletions
|
|
@ -3,12 +3,13 @@ import Layout from 'components/layout/Layout';
|
|||
import TestConsole from 'components/pages/TestConsole';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import useUser from 'hooks/useUser';
|
||||
import { ROLES } from 'lib/constants';
|
||||
|
||||
export default function ConsolePage({ pageDisabled }) {
|
||||
const { loading } = useRequireLogin();
|
||||
const { user } = useUser();
|
||||
|
||||
if (pageDisabled || loading || !user?.isAdmin) {
|
||||
if (pageDisabled || loading || user?.role !== ROLES.admin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue