[ML] Add user privilege check to Jobs List group selector control (#25225) (#25276)

This commit is contained in:
Pete Harverson 2018-11-07 11:38:48 +00:00 committed by GitHub
parent d68e9a7b8e
commit 0863fb3bdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@
*/ */
import { checkPermission } from 'plugins/ml/privilege/check_privilege';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { import React, {
Component, Component,
@ -66,6 +67,7 @@ export class GroupSelector extends Component {
}; };
this.refreshJobs = this.props.refreshJobs; this.refreshJobs = this.props.refreshJobs;
this.canUpdateJob = checkPermission('canUpdateJob');
} }
static getDerivedStateFromProps(props, state) { static getDerivedStateFromProps(props, state) {
@ -204,6 +206,7 @@ export class GroupSelector extends Component {
iconType="indexEdit" iconType="indexEdit"
aria-label="Edit job groups" aria-label="Edit job groups"
onClick={() => this.togglePopover()} onClick={() => this.togglePopover()}
disabled={this.canUpdateJob === false}
/> />
</EuiToolTip> </EuiToolTip>
); );