Skip to content

Commit

Permalink
give analyze route access to ml user
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Mar 10, 2021
1 parent 85fc0f6 commit 34c2686
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/file_upload/server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 6 additions & 2 deletions x-pack/plugins/ml/common/types/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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,
Expand Down

0 comments on commit 34c2686

Please sign in to comment.