Skip to content

Commit

Permalink
kdump: disable test configuration button for non-admin
Browse files Browse the repository at this point in the history
Test crashing the kernel is shown as an option while it requires admin
privileges to work.

Related: #19431
  • Loading branch information
jelly committed Oct 6, 2023
1 parent 1f0e79d commit c6fa994
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/kdump/kdump-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { fmt_to_fragments } from 'utils.jsx';
import { show_modal_dialog } from "cockpit-components-dialog.jsx";
import { FormHelper } from "cockpit-components-form-helper";
import { ModalError } from 'cockpit-components-inline-notification.jsx';
import { PrivilegedButton } from "cockpit-components-privileged.jsx";

const _ = cockpit.gettext;

Expand Down Expand Up @@ -441,9 +442,11 @@ export class KdumpPage extends React.Component {
let testButton;
if (serviceRunning) {
testButton = (
<Button variant="secondary" onClick={this.handleTestSettingsClick}>
{_("Test configuration")}
</Button>
<PrivilegedButton variant="secondary"
excuse={ _("The user $0 is not permitted to test crash the kernel") }
onClick={this.handleTestSettingsClick}>
{ _("Test configuration") }
</PrivilegedButton>
);
} else {
const tooltip = _("Test is only available while the kdump service is running.");
Expand Down

0 comments on commit c6fa994

Please sign in to comment.