Get user privileges Added in 6.5.0

GET /_security/user/_privileges

Query parameters

  • The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, the API returns information about all privileges for all applications.

  • The name of the privilege. If you do not specify this parameter, the API returns information about all privileges for the requested application.

  • username string | null

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • applications array[object] Required
      Hide applications attributes Show applications attributes object
      • application string Required

        The name of the application to which this entry applies.

      • privileges array[string] Required

        A list of strings, where each element is the name of an application privilege or action.

      • resources array[string] Required

        A list resources to which the privileges are applied.

    • cluster array[string] Required
    • global array[object] Required
      Hide global attribute Show global attribute object
      • application object Required

        Additional properties are allowed.

        Hide application attribute Show application attribute object
        • manage object Required

          Additional properties are allowed.

          Hide manage attribute Show manage attribute object
    • indices array[object] Required
      Hide indices attributes Show indices attributes object
      • field_security array[object]

        The document fields that the owners of the role have read access to.

        Hide field_security attributes Show field_security attributes object
      • names string | array[string]

        A list of indices (or index name patterns) to which the permissions in this entry apply.

      • privileges array[string] Required

        The index level privileges that owners of the role have on the specified indices.

      • query array[string | object]

        Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.

        While creating or updating a role you can provide either a JSON structure or a string to the API. However, the response provided by Elasticsearch will only be string with a json-as-text content.

        Since this is embedded in IndicesPrivileges, the same structure is used for clarity in both contexts.

        One of:

        Additional properties are allowed.

      • Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices.

    • run_as array[string] Required
GET /_security/user/_privileges
curl \
 -X GET http://api.example.com/_security/user/_privileges
Response examples (200)
{
  "applications": [
    {
      "application": "string",
      "privileges": [
        "string"
      ],
      "resources": [
        "string"
      ]
    }
  ],
  "cluster": [
    "string"
  ],
  "global": [
    {
      "application": {
        "manage": {
          "applications": [
            "string"
          ]
        }
      }
    }
  ],
  "indices": [
    {
      "field_security": [
        {
          "except": "string",
          "grant": "string"
        }
      ],
      "names": "string",
      "privileges": [
        "string"
      ],
      "query": [
        "string"
      ],
      "allow_restricted_indices": true
    }
  ],
  "run_as": [
    "string"
  ]
}