Skip to content

Commit

Permalink
fix(ui): check for correct role defined before before calling into it (
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrehu authored May 23, 2024
1 parent d29c54d commit f75cb86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/utils/AkhqRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,23 @@ class AkhqRoutes extends Root {
<Route exact path="/ui/:clusterId/topic/create" element={<TopicCreate />} />
)}

{roles && roles.TOPIC && roles.TOPIC_DATA.includes('CREATE') && (
{roles && roles.TOPIC_DATA && roles.TOPIC_DATA.includes('CREATE') && (
<Route
exact
path="/ui/:clusterId/topic/:topicId/produce"
element={<TopicProduce />}
/>
)}

{roles && roles.TOPIC && roles.TOPIC_DATA.includes('CREATE') && (
{roles && roles.TOPIC_DATA && roles.TOPIC_DATA.includes('CREATE') && (
<Route
exact
path="/ui/:clusterId/topic/:topicId/increasepartition"
element={<TopicIncreaseParition />}
/>
)}

{roles && roles.TOPIC && roles.TOPIC_DATA.includes('CREATE') && (
{roles && roles.TOPIC_DATA && roles.TOPIC_DATA.includes('CREATE') && (
<Route exact path="/ui/:clusterId/topic/:topicId/copy" element={<TopicCopy />} />
)}

Expand All @@ -187,7 +187,7 @@ class AkhqRoutes extends Root {
/>
)}

{roles && roles.TOPIC && roles.TOPIC_DATA.includes('READ') && (
{roles && roles.TOPIC_DATA && roles.TOPIC_DATA.includes('READ') && (
<Route exact path="/ui/:clusterId/tail" element={<Tail />} />
)}

Expand Down

0 comments on commit f75cb86

Please sign in to comment.