From 34c268633a371c1ace683189dc7d0c91e4811070 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 10 Mar 2021 13:32:17 -0700 Subject: [PATCH] give analyze route access to ml user --- x-pack/plugins/file_upload/server/routes.ts | 2 +- x-pack/plugins/ml/common/types/capabilities.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/file_upload/server/routes.ts b/x-pack/plugins/file_upload/server/routes.ts index a24982e80d2c4..4f4adb29f6b0b 100644 --- a/x-pack/plugins/file_upload/server/routes.ts +++ b/x-pack/plugins/file_upload/server/routes.ts @@ -59,7 +59,7 @@ export function fileUploadRoutes(router: IRouter) { accepts: ['text/*', 'application/json'], maxBytes: MAX_FILE_SIZE_BYTES, }, - tags: ['access:fileUpload:import'], + tags: ['access:fileUpload:analyzeFile'], }, }, async (context, request, response) => { diff --git a/x-pack/plugins/ml/common/types/capabilities.ts b/x-pack/plugins/ml/common/types/capabilities.ts index 61a5013642cd7..129b496c00149 100644 --- a/x-pack/plugins/ml/common/types/capabilities.ts +++ b/x-pack/plugins/ml/common/types/capabilities.ts @@ -102,7 +102,11 @@ export function getPluginPrivileges() { return { admin: { ...privilege, - api: ['fileUpload:import', ...allMlCapabilitiesKeys.map((k) => `ml:${k}`)], + api: [ + 'fileUpload:import', + 'fileUpload:analyzeFile', + ...allMlCapabilitiesKeys.map((k) => `ml:${k}`), + ], catalogue: [PLUGIN_ID, `${PLUGIN_ID}_file_data_visualizer`], ui: allMlCapabilitiesKeys, savedObject: { @@ -116,7 +120,7 @@ export function getPluginPrivileges() { }, user: { ...privilege, - api: userMlCapabilitiesKeys.map((k) => `ml:${k}`), + api: ['fileUpload:analyzeFile', ...userMlCapabilitiesKeys.map((k) => `ml:${k}`)], catalogue: [PLUGIN_ID], management: { insightsAndAlerting: [] }, ui: userMlCapabilitiesKeys,