Check user privileges Added in 6.4.0
Determine whether the specified user has a specified list of privileges. 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.
Body Required
-
application array[object]
-
cluster array[string]
A list of the cluster privileges that you want to check.
-
index array[object]
POST
/_security/user/_has_privileges
curl \
-X POST http://api.example.com/_security/user/_has_privileges \
-H "Content-Type: application/json" \
-d '{"application":[{"application":"string","privileges":["string"],"resources":["string"]}],"cluster":["string"],"index":[{"names":"string","privileges":["string"],"allow_restricted_indices":true}]}'
Request examples
{
"application": [
{
"application": "string",
"privileges": [
"string"
],
"resources": [
"string"
]
}
],
"cluster": [
"string"
],
"index": [
{
"names": "string",
"privileges": [
"string"
],
"allow_restricted_indices": true
}
]
}
Response examples (200)
{
"application": {
"additionalProperty1": {
"additionalProperty1": {
"additionalProperty1": true,
"additionalProperty2": true
},
"additionalProperty2": {
"additionalProperty1": true,
"additionalProperty2": true
}
},
"additionalProperty2": {
"additionalProperty1": {
"additionalProperty1": true,
"additionalProperty2": true
},
"additionalProperty2": {
"additionalProperty1": true,
"additionalProperty2": true
}
}
},
"cluster": {
"additionalProperty1": true,
"additionalProperty2": true
},
"has_all_requested": true,
"index": {
"additionalProperty1": {
"additionalProperty1": true,
"additionalProperty2": true
},
"additionalProperty2": {
"additionalProperty1": true,
"additionalProperty2": true
}
},
"username": "string"
}