Get user privileges API
editGet user privileges API
editRetrieves the security privileges for the logged in user.
Request
editGET /_security/user/_privileges
Prerequisites
edit- 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
editTo check whether a user has a specific list of privileges, use the has privileges API.
Examples
editresp = 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" : [ "*" ] }