From 54f0d1552f58305235e7033432dd0f781532fc1c Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Wed, 16 Sep 2020 09:47:02 +0100 Subject: [PATCH] [ML] Fixing field caps wrapper endpoint (#77546) --- 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));