From 6453aca185bab9547b6b9c8ac00cfc7da3eb230a Mon Sep 17 00:00:00 2001 From: Muhsin Shah C P Date: Fri, 6 Jan 2023 00:31:32 +0530 Subject: [PATCH] fix: now menu item will hide for non-admin user (#5222) --- frontend/src/_ui/Layout/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/_ui/Layout/index.jsx b/frontend/src/_ui/Layout/index.jsx index 8ede1c78f1..38e720aa51 100644 --- a/frontend/src/_ui/Layout/index.jsx +++ b/frontend/src/_ui/Layout/index.jsx @@ -6,9 +6,11 @@ import { Profile } from '@/_components/Profile'; import { NotificationCenter } from '@/_components/NotificationCenter'; import Logo from '@assets/images/rocket.svg'; import Header from '../Header'; +import { authenticationService } from '@/_services'; function Layout({ children, switchDarkMode, darkMode }) { const router = useRouter(); + const { admin } = authenticationService.currentUserValue; return (
@@ -47,7 +49,7 @@ function Layout({ children, switchDarkMode, darkMode }) { - {window.public_config?.ENABLE_TOOLJET_DB == 'true' && ( + {window.public_config?.ENABLE_TOOLJET_DB == 'true' && admin && (