Skip to content

Commit 75f40cd

Browse files
committed
FE: RBAC problem for broker settings
Resolves: #1051
1 parent 089b072 commit 75f40cd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

frontend/src/components/Brokers/Broker/Configs/TableComponents/InputCell/InputCellViewMode.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React, { type FC } from 'react';
2-
import { Button } from 'components/common/Button/Button';
32
import EditIcon from 'components/common/Icons/EditIcon';
43
import type { ConfigUnit } from 'components/Brokers/Broker/Configs/lib/types';
54
import Tooltip from 'components/common/Tooltip/Tooltip';
65
import { getConfigDisplayValue } from 'components/Brokers/Broker/Configs/lib/utils';
6+
import { ActionButton } from 'components/common/ActionComponent';
7+
import { Action, ResourceType } from 'generated-sources';
78

89
import * as S from './styled';
910

@@ -37,15 +38,20 @@ const InputCellViewMode: FC<InputCellViewModeProps> = ({
3738
</S.Value>
3839
<Tooltip
3940
value={
40-
<Button
41+
<ActionButton
4142
buttonType="primary"
4243
buttonSize="S"
4344
aria-label="editAction"
4445
onClick={onEdit}
4546
disabled={isReadOnly}
47+
message={isReadOnly ? '' : undefined}
48+
permission={{
49+
resource: ResourceType.CLUSTERCONFIG,
50+
action: Action.EDIT,
51+
}}
4652
>
4753
<EditIcon /> Edit
48-
</Button>
54+
</ActionButton>
4955
}
5056
showTooltip={isReadOnly}
5157
content="Property is read-only"

frontend/src/components/common/ActionComponent/ActionButton/ActionCanButton/ActionCanButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const ActionButton: React.FC<Props> = ({
2828
return (
2929
<S.Wrapper ref={refs.setReference}>
3030
<Button {...props} disabled={disabled || isDisabled} />
31-
{open && (
31+
{open && message && (
3232
<S.MessageTooltipLimited
3333
ref={refs.setFloating}
3434
style={{

0 commit comments

Comments
 (0)