MSP-3542 update permissions in SessionsPage and SecurityLogPage
This commit is contained in:
1 parent
3b129d4c52
commit
f27e0ff5a9
2 files changed
+5
-6
No files matched your search
@@ -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 })
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<CanEdit>
|
||||
{hasRevokePermission && (
|
||||
<Popconfirm
|
||||
title="Закончить эту сессию?"
|
||||
onConfirm={() => handleRevokeSessions(record.id)}
|
||||
@@ -136,7 +135,7 @@ const SessionsPage = () => {
|
||||
/>
|
||||
</Tooltip>
|
||||
</Popconfirm>
|
||||
</CanEdit>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user