MSP-3106 refactor CatEdit component
This commit is contained in:
1 parent
4a9c263646
commit
d31c8b085f
1 file changed
+3
-3
@@ -4,13 +4,13 @@ import { useRole } from '@hooks/useRole.tsx'
|
||||
|
||||
import { PermissionKeysType } from '@type/roles.type.ts'
|
||||
|
||||
const AdminPermission = ({ children }: PropsWithChildren) => {
|
||||
const CanEdit = ({ children }: PropsWithChildren) => {
|
||||
const { hasPermission } = useRole()
|
||||
|
||||
if (hasPermission(PermissionKeysType.read)) {
|
||||
if (hasPermission(PermissionKeysType.write)) {
|
||||
return <>{children}</>
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export default AdminPermission
|
||||
export default CanEdit
|
||||
Reference in new issue
Block a user