Get user privileges API

edit

Retrieves the security privileges for the logged in user.

Request

edit

GET /_security/user/_privileges

Prerequisites

edit

Description

edit

To check whether a user has a specific list of privileges, use the has privileges API.

Examples

edit
resp = client.security.get_user_privileges()
print(resp)
const response = await client.security.getUserPrivileges();
console.log(response);
GET /_security/user/_privileges
{
  "cluster" : [
    "all"
  ],
  "global" : [ ],
  "indices" : [
    {
      "names" : [
        "*"
      ],
      "privileges" : [
        "all"
      ],
      "allow_restricted_indices" : true
    }
  ],
  "applications" : [
    {
      "application" : "*",
      "privileges" : [
        "*"
      ],
      "resources" : [
        "*"
      ]
    }
  ],
  "run_as" : [
    "*"
  ]
}