Skip to content

Commit bde38be

Browse files
committed
[ML] Fixes permissions checks for data visualizer create job links
1 parent 2bf111c commit bde38be

File tree

1 file changed

+9
-2
lines changed
  • x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based

1 file changed

+9
-2
lines changed

x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/page.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import { NavigationMenu } from '../../components/navigation_menu';
3333
import { ML_JOB_FIELD_TYPES } from '../../../../common/constants/field_types';
3434
import { SEARCH_QUERY_LANGUAGE } from '../../../../common/constants/search';
3535
import { isFullLicense } from '../../license/check_license';
36+
import { checkPermission } from '../../privilege/check_privilege';
37+
import { mlNodesAvailable } from '../../ml_nodes_check/check_ml_nodes';
3638
import { FullTimeRangeSelector } from '../../components/full_time_range_selector';
3739
import { mlTimefilterRefresh$ } from '../../services/timefilter_refresh_service';
3840
import { useKibanaContext, SavedSearchQuery } from '../../contexts/kibana';
@@ -131,7 +133,10 @@ export const Page: FC = () => {
131133
const defaults = getDefaultPageState();
132134

133135
const [showActionsPanel] = useState(
134-
isFullLicense() && currentIndexPattern.timeFieldName !== undefined
136+
isFullLicense() &&
137+
checkPermission('canCreateJob') &&
138+
mlNodesAvailable() &&
139+
currentIndexPattern.timeFieldName !== undefined
135140
);
136141

137142
const [searchString, setSearchString] = useState(defaults.searchString);
@@ -613,7 +618,9 @@ export const Page: FC = () => {
613618
)}
614619
</EuiPageContentHeader>
615620
</EuiFlexItem>
616-
<EuiFlexItem grow={false} style={{ width: wizardPanelWidth }} />
621+
{showActionsPanel === true && (
622+
<EuiFlexItem grow={false} style={{ width: wizardPanelWidth }} />
623+
)}
617624
</EuiFlexGroup>
618625
<EuiSpacer size="m" />
619626
<EuiPageContentBody>

0 commit comments

Comments
 (0)