MSP-3105 change layout.type.ts and roles.type.ts

This commit is contained in:
Anastasiia committed 2024-04-19 14:20:50 +03:00
1 parent a380067908
commit 42ee1697c4
8 files changed
+34 -39

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
import { useMemo } from 'react'
import { PermissionKeys } from '@type/roles.type.ts'
import { PermissionKeysType } from '@type/roles.type.ts'
import { useAppSelector } from './redux.ts'
@@ -8,7 +8,7 @@ export const useRole = () => {
const { profile } = useAppSelector((state: any) => state.profileReducer)
const role: string = useMemo(() => profile && profile.role, [profile])
const hasPermission = (permission: PermissionKeys) => {
const hasPermission = (permission: PermissionKeysType) => {
const userPermission = profile.permissions || []
return userPermission.includes(permission)
}