Skip to content

Commit

Permalink
[ML] Fixes permissions checks for data visualizer create job links
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson committed Jan 21, 2020
1 parent 2bf111c commit bde38be
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { NavigationMenu } from '../../components/navigation_menu';
import { ML_JOB_FIELD_TYPES } from '../../../../common/constants/field_types';
import { SEARCH_QUERY_LANGUAGE } from '../../../../common/constants/search';
import { isFullLicense } from '../../license/check_license';
import { checkPermission } from '../../privilege/check_privilege';
import { mlNodesAvailable } from '../../ml_nodes_check/check_ml_nodes';
import { FullTimeRangeSelector } from '../../components/full_time_range_selector';
import { mlTimefilterRefresh$ } from '../../services/timefilter_refresh_service';
import { useKibanaContext, SavedSearchQuery } from '../../contexts/kibana';
Expand Down Expand Up @@ -131,7 +133,10 @@ export const Page: FC = () => {
const defaults = getDefaultPageState();

const [showActionsPanel] = useState(
isFullLicense() && currentIndexPattern.timeFieldName !== undefined
isFullLicense() &&
checkPermission('canCreateJob') &&
mlNodesAvailable() &&
currentIndexPattern.timeFieldName !== undefined
);

const [searchString, setSearchString] = useState(defaults.searchString);
Expand Down Expand Up @@ -613,7 +618,9 @@ export const Page: FC = () => {
)}
</EuiPageContentHeader>
</EuiFlexItem>
<EuiFlexItem grow={false} style={{ width: wizardPanelWidth }} />
{showActionsPanel === true && (
<EuiFlexItem grow={false} style={{ width: wizardPanelWidth }} />
)}
</EuiFlexGroup>
<EuiSpacer size="m" />
<EuiPageContentBody>
Expand Down

0 comments on commit bde38be

Please sign in to comment.