File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
kafka-ui-react-app/src/components/Dashboard Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ const ClusterTableActionsCell: React.FC<Props> = ({ row }) => {
1111 const { name } = row . original ;
1212 const { data } = useGetUserInfo ( ) ;
1313
14- const isApplicationConfig = useMemo ( ( ) => {
14+ const hasPermissions = useMemo ( ( ) => {
15+ if ( ! data ?. rbacEnabled ) return true ;
1516 return ! ! data ?. userInfo ?. permissions . some (
1617 ( permission ) => permission . resource === ResourceType . APPLICATIONCONFIG
1718 ) ;
@@ -22,7 +23,7 @@ const ClusterTableActionsCell: React.FC<Props> = ({ row }) => {
2223 buttonType = "secondary"
2324 buttonSize = "S"
2425 to = { clusterConfigPath ( name ) }
25- canDoAction = { isApplicationConfig }
26+ canDoAction = { hasPermissions }
2627 >
2728 Configure
2829 </ ActionCanButton >
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ const Dashboard: React.FC = () => {
5757 return initialColumns ;
5858 } , [ ] ) ;
5959
60- const isApplicationConfig = useMemo ( ( ) => {
60+ const hasPermissions = useMemo ( ( ) => {
61+ if ( ! data ?. rbacEnabled ) return true ;
6162 return ! ! data ?. userInfo ?. permissions . some (
6263 ( permission ) => permission . resource === ResourceType . APPLICATIONCONFIG
6364 ) ;
@@ -91,7 +92,7 @@ const Dashboard: React.FC = () => {
9192 buttonType = "primary"
9293 buttonSize = "M"
9394 to = { clusterNewConfigPath }
94- canDoAction = { isApplicationConfig }
95+ canDoAction = { hasPermissions }
9596 >
9697 Configure new cluster
9798 </ ActionCanButton >
You can’t perform that action at this time.
0 commit comments