From f27e0ff5a9d17187bd7b7e0d4e602abbb3d68588 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Tue, 2 Jul 2024 09:46:02 +0700 Subject: [PATCH] MSP-3542 update permissions in SessionsPage and SecurityLogPage --- src/pages/SecurityLogPage/index.tsx | 2 +- src/pages/SessionsPage/index.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/SecurityLogPage/index.tsx b/src/pages/SecurityLogPage/index.tsx index f48f057..dc994d6 100644 --- a/src/pages/SecurityLogPage/index.tsx +++ b/src/pages/SecurityLogPage/index.tsx @@ -33,7 +33,7 @@ const SecurityLogPage = () => { const [currentPage, setCurrentPage] = useState(1) const isLoading = isUsersLoading || isLoadingLogs - const isPageAvailable = hasPermission(PermissionKeysType.read) + const isPageAvailable = hasPermission(PermissionKeysType.security_log_view) useEffect(() => { getAllLogs({ limit, offset: 0 }) diff --git a/src/pages/SessionsPage/index.tsx b/src/pages/SessionsPage/index.tsx index 74d9661..c967375 100644 --- a/src/pages/SessionsPage/index.tsx +++ b/src/pages/SessionsPage/index.tsx @@ -14,8 +14,6 @@ import { useNavigate } from 'react-router-dom' import { SessionStatusKeysType, sessionStatuses } from '@constants/statuses' -import CanEdit from '@components/CanEdit' - import { getUserFullName } from '@utils/userUtils/getFullNameUtil' import useRole from '@hooks/useRole' @@ -47,7 +45,8 @@ const SessionsPage = () => { const isLoading = isUsersLoading || isLoadingSession - const isPageAvailable = hasPermission(PermissionKeysType.read) + const isPageAvailable = hasPermission(PermissionKeysType.session_view) + const hasRevokePermission = hasPermission(PermissionKeysType.session_revoke) useEffect(() => { if (!isPageAvailable) { @@ -124,7 +123,7 @@ const SessionsPage = () => { } return ( <> - + {hasRevokePermission && ( handleRevokeSessions(record.id)} @@ -136,7 +135,7 @@ const SessionsPage = () => { /> - + )} ) }