From eca69516374cf2927e958e6b70502b038284756a Mon Sep 17 00:00:00 2001 From: Angela Chuang <6295984+angorayc@users.noreply.github.com> Date: Tue, 26 Nov 2024 19:43:08 +0000 Subject: [PATCH] [SecuritySolution] Add ml.canGetMlInfo capabilities (#201652) ## Summary Fixes: https://github.com/elastic/kibana/issues/189893 https://github.com/elastic/kibana/issues/189948 Steps to verify: 1. Open `packages/kbn-es/src/serverless_resources/project_roles/security/roles.yml`, comment feature_ml.read from t1_analyst 2. Open kibana serverless locally as t1_analyst, see links are not displayed 3. Open kibana serverless locally as t2_analyst, see the links are displayed --- .../app/solution_navigation/links/sections/ml_links.ts | 2 +- x-pack/plugins/security_solution/public/explore/links.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts b/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts index 7a7e7334fefb3..f9ef049c73d30 100644 --- a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts +++ b/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts @@ -39,7 +39,7 @@ export const mlAppLink: LinkItem = { id: SecurityPageName.mlLanding, title: i18n.ML_TITLE, path: MACHINE_LEARNING_PATH, - capabilities: [`${SERVER_APP_ID}.show`], + capabilities: [[`${SERVER_APP_ID}.show`, `ml.canGetJobs`]], globalSearchKeywords: [i18n.ML_KEYWORD], hideTimeline: true, skipUrlState: true, diff --git a/x-pack/plugins/security_solution/public/explore/links.ts b/x-pack/plugins/security_solution/public/explore/links.ts index b1cad1b34db3b..a65eccc95c372 100644 --- a/x-pack/plugins/security_solution/public/explore/links.ts +++ b/x-pack/plugins/security_solution/public/explore/links.ts @@ -34,6 +34,7 @@ const networkLinks: LinkItem = { defaultMessage: 'Network', }), ], + capabilities: [`${SERVER_APP_ID}.show`], links: [ { id: SecurityPageName.networkFlows, @@ -68,6 +69,7 @@ const networkLinks: LinkItem = { title: i18n.translate('xpack.securitySolution.appLinks.hosts.anomalies', { defaultMessage: 'Anomalies', }), + capabilities: ['ml.canGetJobs'], path: `${NETWORK_PATH}/anomalies`, licenseType: 'gold', }, @@ -95,6 +97,7 @@ const usersLinks: LinkItem = { defaultMessage: 'Users', }), ], + capabilities: [`${SERVER_APP_ID}.show`], links: [ { id: SecurityPageName.usersAll, @@ -115,6 +118,7 @@ const usersLinks: LinkItem = { title: i18n.translate('xpack.securitySolution.appLinks.users.anomalies', { defaultMessage: 'Anomalies', }), + capabilities: ['ml.canGetJobs'], path: `${USERS_PATH}/anomalies`, licenseType: 'gold', }, @@ -148,6 +152,7 @@ const hostsLinks: LinkItem = { defaultMessage: 'Hosts', }), ], + capabilities: [`${SERVER_APP_ID}.show`], links: [ { id: SecurityPageName.hostsAll, @@ -169,6 +174,7 @@ const hostsLinks: LinkItem = { title: i18n.translate('xpack.securitySolution.appLinks.hosts.anomalies', { defaultMessage: 'Anomalies', }), + capabilities: ['ml.canGetJobs'], path: `${HOSTS_PATH}/anomalies`, licenseType: 'gold', },