Skip to content

Commit f75cb86

Browse files
authoredMay 23, 2024
fix(ui): check for correct role defined before before calling into it (#1785)
close #1784
1 parent d29c54d commit f75cb86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎client/src/utils/AkhqRoutes.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,23 @@ class AkhqRoutes extends Root {
159159
<Route exact path="/ui/:clusterId/topic/create" element={<TopicCreate />} />
160160
)}
161161

162-
{roles && roles.TOPIC && roles.TOPIC_DATA.includes('CREATE') && (
162+
{roles && roles.TOPIC_DATA && roles.TOPIC_DATA.includes('CREATE') && (
163163
<Route
164164
exact
165165
path="/ui/:clusterId/topic/:topicId/produce"
166166
element={<TopicProduce />}
167167
/>
168168
)}
169169

170-
{roles && roles.TOPIC && roles.TOPIC_DATA.includes('CREATE') && (
170+
{roles && roles.TOPIC_DATA && roles.TOPIC_DATA.includes('CREATE') && (
171171
<Route
172172
exact
173173
path="/ui/:clusterId/topic/:topicId/increasepartition"
174174
element={<TopicIncreaseParition />}
175175
/>
176176
)}
177177

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

@@ -187,7 +187,7 @@ class AkhqRoutes extends Root {
187187
/>
188188
)}
189189

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

0 commit comments

Comments
 (0)