Get user privileges Generally available; Added in 6.5.0

GET /_security/user/_privileges

Get the security privileges for the logged in user. All users can use this API, but only to determine their own privileges. To check the privileges of other users, you must use the run as feature. To check whether a user has a specific list of privileges, use the has privileges API.

Responses

GET /_security/user/_privileges
resp = client.security.get_user_privileges()
const response = await client.security.getUserPrivileges();
response = client.security.get_user_privileges
$resp = $client->security()->getUserPrivileges();
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_security/user/_privileges"
client.security().getUserPrivileges(g -> g);
Response examples (200)
A successful response from `GET /_security/user/_privileges`.
{
  "cluster" : [
    "all"
  ],
  "global" : [ ],
  "indices" : [
    {
      "names" : [
        "*"
      ],
      "privileges" : [
        "all"
      ],
      "allow_restricted_indices" : true
    }
  ],
  "applications" : [
    {
      "application" : "*",
      "privileges" : [
        "*"
      ],
      "resources" : [
        "*"
      ]
    }
  ],
  "run_as" : [
    "*"
  ]
}