Spec-Zone.ru › Elasticsearch 7
›Elasticsearch Guide [7.17] ›REST APIs ›Security APIs

Get application privileges API

Retrieves application privileges.

Request

GET /_security/privilege

GET /_security/privilege/<application>

GET /_security/privilege/<application>/<privilege>

Prerequisites

To use this API, you must have either:

  • the manage_security cluster privilege (or a greater privilege such as all); or
  • the "Manage Application Privileges" global privilege for the application being referenced in the request

Description

To check a user’s application privileges, use the has privileges API.

Path parameters

application
(Optional, string) 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.
privilege
(Optional, string) The name of the privilege. If you do not specify this parameter, the API returns information about all privileges for the requested application.

Examples

The following example retrieves information about the read privilege for the app01 application:

GET /_security/privilege/myapp/read

A successful call returns an object keyed by application name and privilege name. If the privilege is not defined, the request responds with a 404 status.

{
  "myapp": {
    "read": {
      "application": "myapp",
      "name": "read",
      "actions": [
        "data:read/*",
        "action:login"
      ],
      "metadata": {
        "description": "Read access to myapp"
      }
    }
  }
}

To retrieve all privileges for an application, omit the privilege name:

GET /_security/privilege/myapp/

To retrieve every privilege, omit both the application and privilege names:

GET /_security/privilege/

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-api-get-privileges.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API