Get user privileges API
Get user privileges API
New API reference
For the most up-to-date API details, refer to Security APIs.
Retrieves the security privileges for the logged in user.
Request
GET /_security/user/_privileges
Prerequisites
- 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. For more information, see Submitting requests on behalf of other users.
Description
To check whether a user has a specific list of privileges, use the has privileges API.
Examples
resp = client.security.get_user_privileges()
print(resp)
const response = await client.security.getUserPrivileges();
console.log(response);
GET /_security/user/_privileges
{
"cluster" : [
"all"
],
"global" : [ ],
"indices" : [
{
"names" : [
"*"
],
"privileges" : [
"all"
],
"allow_restricted_indices" : true
}
],
"applications" : [
{
"application" : "*",
"privileges" : [
"*"
],
"resources" : [
"*"
]
}
],
"run_as" : [
"*"
]
}
当前内容版权归 elasticsearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 elasticsearch .