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

Description

To check whether a user has a specific list of privileges, use the has privileges API.

Examples

  1. resp = client.security.get_user_privileges()
  2. print(resp)
  1. const response = await client.security.getUserPrivileges();
  2. console.log(response);
  1. GET /_security/user/_privileges
  1. {
  2. "cluster" : [
  3. "all"
  4. ],
  5. "global" : [ ],
  6. "indices" : [
  7. {
  8. "names" : [
  9. "*"
  10. ],
  11. "privileges" : [
  12. "all"
  13. ],
  14. "allow_restricted_indices" : true
  15. }
  16. ],
  17. "applications" : [
  18. {
  19. "application" : "*",
  20. "privileges" : [
  21. "*"
  22. ],
  23. "resources" : [
  24. "*"
  25. ]
  26. }
  27. ],
  28. "run_as" : [
  29. "*"
  30. ]
  31. }