Skip to content

Commit

Permalink
FE: RBAC: Fix cluster config menu item is always enabled (#4130)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haarolean authored Aug 18, 2023
1 parent 6224b12 commit 3114509
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kafka-ui-react-app/src/components/Brokers/Broker/Broker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import BrokerLogdir from 'components/Brokers/Broker/BrokerLogdir/BrokerLogdir';
import BrokerMetrics from 'components/Brokers/Broker/BrokerMetrics/BrokerMetrics';
import Navbar from 'components/common/Navigation/Navbar.styled';
import PageLoader from 'components/common/PageLoader/PageLoader';
import { ActionNavLink } from 'components/common/ActionComponent';
import { Action, ResourceType } from 'generated-sources';

import Configs from './Configs/Configs';

Expand Down Expand Up @@ -71,12 +73,16 @@ const Broker: React.FC = () => {
>
Configs
</NavLink>
<NavLink
<ActionNavLink
to={clusterBrokerMetricsPath(clusterName, brokerId)}
className={({ isActive }) => (isActive ? 'is-active' : '')}
permission={{
resource: ResourceType.CLUSTERCONFIG,
action: Action.VIEW,
}}
>
Metrics
</NavLink>
</ActionNavLink>
</Navbar>
<Suspense fallback={<PageLoader />}>
<Routes>
Expand Down

0 comments on commit 3114509

Please sign in to comment.