RBAC: hide save button for users who can't save dashboard (#85758)

hide save button for users who can't save dashboard
This commit is contained in:
Ieva 2024-04-09 17:09:41 +01:00 committed by GitHub
parent 27bc0c19ab
commit 9a2969fb4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -333,27 +333,28 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
>
Discard
</Button>,
this.props.panel.libraryPanel ? (
<Button
onClick={this.onSaveLibraryPanel}
variant="primary"
size={size}
title="Apply changes and save library panel"
key="save-panel"
>
Save library panel
</Button>
) : (
<Button
onClick={this.onSaveDashboard}
title="Apply changes and save dashboard"
key="save"
size={size}
variant="secondary"
>
Save
</Button>
),
this.props.dashboard.meta.canSave &&
(this.props.panel.libraryPanel ? (
<Button
onClick={this.onSaveLibraryPanel}
variant="primary"
size={size}
title="Apply changes and save library panel"
key="save-panel"
>
Save library panel
</Button>
) : (
<Button
onClick={this.onSaveDashboard}
title="Apply changes and save dashboard"
key="save"
size={size}
variant="secondary"
>
Save
</Button>
)),
<Button
onClick={this.onBack}
variant="primary"