From e18cd870efbb2951e9bfe3f56c31a47c370ac2e7 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Tue, 15 Sep 2020 21:32:50 +0100 Subject: [PATCH] [ML] Fixing field caps wrapper endpoint --- x-pack/plugins/ml/server/routes/indices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/server/routes/indices.ts b/x-pack/plugins/ml/server/routes/indices.ts index ee817c492dbd4..8a5df1415bde8 100644 --- a/x-pack/plugins/ml/server/routes/indices.ts +++ b/x-pack/plugins/ml/server/routes/indices.ts @@ -40,7 +40,7 @@ export function indicesRoutes({ router, mlLicense }: RouteInitialization) { requestFields !== undefined && Array.isArray(requestFields) ? requestFields.join(',') : '*'; - const { body } = await client.asInternalUser.fieldCaps({ index, fields }); + const { body } = await client.asCurrentUser.fieldCaps({ index, fields }); return response.ok({ body }); } catch (e) { return response.customError(wrapError(e));