From 6015900f57fc12a7df589c8442238ed0aa7b27e2 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Fri, 25 Oct 2024 16:32:41 +0800 Subject: [PATCH] update audit log auth --- src/layout/MainLayout/Header/index.js | 2 +- src/pages/AuditLog/AuditLogSearchForm.js | 28 ++++++++++++++---------- src/routes/GLDUserRoutes.js | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 5d0055a..b5370a7 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -325,7 +325,7 @@ function Header(props) { <> } { - isGranted("MAINTAIN_USER") ? + isGranted("MAINTAIN_SETTING") ?
  • Audit Log
  • diff --git a/src/pages/AuditLog/AuditLogSearchForm.js b/src/pages/AuditLog/AuditLogSearchForm.js index 8236d9e..0b65326 100644 --- a/src/pages/AuditLog/AuditLogSearchForm.js +++ b/src/pages/AuditLog/AuditLogSearchForm.js @@ -29,6 +29,8 @@ import dayjs from "dayjs"; import {DemoItem} from "@mui/x-date-pickers/internals/demo"; import {LocalizationProvider} from "@mui/x-date-pickers/LocalizationProvider"; import {AdapterDayjs} from "@mui/x-date-pickers/AdapterDayjs"; +import { isGranted } from "auth/utils"; + // ==============================|| DASHBOARD - DEFAULT ||============================== // const AuditLogSearchForm = ({ applySearch, searchCriteria, onGridReady}) => { // const navigate = useNavigate(); @@ -185,18 +187,20 @@ const AuditLogSearchForm = ({ applySearch, searchCriteria, onGridReady}) => { - - {onDownload? - - : - - } - + {isGranted("MAINTAIN_SETTING") ? + + {onDownload? + + : + + } + : null + }