diff --git a/package-lock.json b/package-lock.json index 1d10d771e..3f87266a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,9 @@ "@patternfly/react-core": "^4.276.11", "@patternfly/react-icons": "^4.93.7", "@patternfly/react-table": "^4.113.3", - "@redhat-cloud-services/frontend-components": "^3.11.2", + "@redhat-cloud-services/frontend-components": "^3.11.3", "@redhat-cloud-services/frontend-components-notifications": "^3.2.14", - "@redhat-cloud-services/frontend-components-utilities": "^3.7.4", + "@redhat-cloud-services/frontend-components-utilities": "^3.7.5", "@redhat-cloud-services/host-inventory-client": "1.2.3", "@unleash/proxy-client-react": "^3.5.0", "awesome-debounce-promise": "^2.1.0", @@ -4684,9 +4684,9 @@ } }, "node_modules/@redhat-cloud-services/frontend-components": { - "version": "3.11.2", - "resolved": "https://registry.npmjs.org/@redhat-cloud-services/frontend-components/-/frontend-components-3.11.2.tgz", - "integrity": "sha512-u4NA5dYJbEgYaQcp+q5KRk4msgii73FDB9CMlSUqMV+tDv6igD2GB4VanR5cDZglio20BMn624IFvNVSA+NiNQ==", + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/@redhat-cloud-services/frontend-components/-/frontend-components-3.11.3.tgz", + "integrity": "sha512-KP8B8ggHVxoxKiLGHcWct7gnbXKL1oqket02qDrm+asSAfMKjABxif/gm9DOGj8lub6lRoRLM2/XW2cKRxSFzA==", "dependencies": { "@redhat-cloud-services/frontend-components-utilities": "^3.2.25", "@redhat-cloud-services/types": "^0.0.24", @@ -4996,9 +4996,9 @@ } }, "node_modules/@redhat-cloud-services/frontend-components-utilities": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@redhat-cloud-services/frontend-components-utilities/-/frontend-components-utilities-3.7.4.tgz", - "integrity": "sha512-MttPapDXcmBXyUXr1b5/FaOOK0/fuGimHLp0zz/qra6bOlL7NgbEGlWoaSu7mACcAsePZgjQcFli2JrFwwD4bg==", + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/@redhat-cloud-services/frontend-components-utilities/-/frontend-components-utilities-3.7.5.tgz", + "integrity": "sha512-izNgQpuX93XxrxCQZ702sd7k8kcm/RtOj8pGDWObwHVryFm11bsflX82GdOtSSu/AYtgPiyXSOmmn9Rxw1ZcXQ==", "dependencies": { "@redhat-cloud-services/types": "^0.0.24", "@sentry/browser": "^5.30.0", diff --git a/package.json b/package.json index 39b3a5617..291d09a6f 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,9 @@ "@patternfly/react-table": "^4.113.3", "@patternfly/react-core": "^4.276.11", "@patternfly/react-icons": "^4.93.7", - "@redhat-cloud-services/frontend-components": "^3.11.2", + "@redhat-cloud-services/frontend-components": "^3.11.3", "@redhat-cloud-services/frontend-components-notifications": "^3.2.14", - "@redhat-cloud-services/frontend-components-utilities": "^3.7.4", + "@redhat-cloud-services/frontend-components-utilities": "^3.7.5", "@redhat-cloud-services/host-inventory-client": "1.2.3", "@unleash/proxy-client-react": "^3.5.0", "awesome-debounce-promise": "^2.1.0", diff --git a/src/Utilities/Wrapper.js b/src/Utilities/Wrapper.js index f130fdf80..efd9076e6 100644 --- a/src/Utilities/Wrapper.js +++ b/src/Utilities/Wrapper.js @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { usePermissions } from '@redhat-cloud-services/frontend-components-utilities/RBACHook'; +import { usePermissionsWithContext } from '@redhat-cloud-services/frontend-components-utilities/RBACHook'; +import { GENERAL_HOSTS_READ_PERMISSIONS } from '../constants'; const RenderWrapper = ({ cmp: Component, @@ -9,7 +10,11 @@ const RenderWrapper = ({ store, ...props }) => { - const { hasAccess } = usePermissions('inventory', ['inventory:hosts:read']); + const { hasAccess } = usePermissionsWithContext( + [GENERAL_HOSTS_READ_PERMISSIONS], + true, + false // omit RD check to find out if there are any inventory:hosts:read available + ); return (