Get user privileges Added in 6.5.0
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.
Query parameters
-
application 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.
-
priviledge string
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
GET
/_security/user/_privileges
curl \
--request 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"
]
}