Skip to content

Commit

Permalink
[Transform] update privileges.ts using security namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Dec 7, 2020
1 parent 605b016 commit 4e44a09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions x-pack/plugins/transform/server/routes/api/privileges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export function registerPrivilegesRoute({ router, license }: RouteDependencies)
// Get cluster privileges
const {
body: { has_all_requested: hasAllPrivileges, cluster },
} = await ctx.core.elasticsearch.client.asCurrentUser.transport.request({
path: '/_security/user/_has_privileges',
} = await ctx.core.elasticsearch.client.asCurrentUser.security.hasPrivileges({
method: 'POST',
body: {
cluster: APP_CLUSTER_PRIVILEGES,
Expand All @@ -44,8 +43,7 @@ export function registerPrivilegesRoute({ router, license }: RouteDependencies)
// Get all index privileges the user has
const {
body: { indices },
} = await ctx.core.elasticsearch.client.asCurrentUser.transport.request({
path: '/_security/user/_privileges',
} = await ctx.core.elasticsearch.client.asCurrentUser.security.getUserPrivileges({
method: 'GET',
});

Expand Down

0 comments on commit 4e44a09

Please sign in to comment.