get-builtin-privileges.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. [role="xpack"]
  2. [[security-api-get-builtin-privileges]]
  3. === Get builtin privileges API
  4. ++++
  5. <titleabbrev>Get builtin privileges</titleabbrev>
  6. ++++
  7. Retrieves the list of
  8. {stack-ov}/security-privileges.html#privileges-list-cluster[cluster privileges] and
  9. {stack-ov}/security-privileges.html#privileges-list-indices[index privileges] that are
  10. available in this version of {es}.
  11. [[security-api-get-builtin-privileges-request]]
  12. ==== {api-request-title}
  13. `GET /_security/privilege/_builtin`
  14. [[security-api-get-builtin-privileges-prereqs]]
  15. ==== {api-prereq-title}
  16. * To use this API, you must have - the `manage_security` cluster privilege
  17. (or a greater privilege such as `all`).
  18. [[security-api-get-builtin-privileges-desc]]
  19. ==== {api-description-title}
  20. This API retrieves the set of cluster and index privilege names that are
  21. available in the version of {es} that is being queried.
  22. To check whether a user has particular privileges, use the
  23. <<security-api-has-privileges,has privileges API>>.
  24. [[security-api-get-builtin-privileges-response-body]]
  25. ==== {api-response-body-title}
  26. The response is an object with two fields:
  27. `cluster`:: (array of string) The list of
  28. {stack-ov}/security-privileges.html#privileges-list-cluster[cluster privileges]
  29. that are understood by this version of {es}
  30. `index`:: (array of string) The list of
  31. {stack-ov}/security-privileges.html#privileges-list-indices[index privileges]
  32. that are understood by this version of {es}
  33. [[security-api-get-builtin-privileges-example]]
  34. ==== {api-examples-title}
  35. The following example retrieves the names of all builtin privileges:
  36. [source,js]
  37. --------------------------------------------------
  38. GET /_security/privilege/_builtin
  39. --------------------------------------------------
  40. // CONSOLE
  41. // TEST
  42. A successful call returns an object with "cluster" and "index" fields.
  43. [source,js]
  44. --------------------------------------------------
  45. {
  46. "cluster" : [
  47. "all",
  48. "create_snapshot",
  49. "manage",
  50. "manage_api_key",
  51. "manage_ccr",
  52. "manage_data_frame_transforms",
  53. "manage_ilm",
  54. "manage_index_templates",
  55. "manage_ingest_pipelines",
  56. "manage_ml",
  57. "manage_oidc",
  58. "manage_pipeline",
  59. "manage_rollup",
  60. "manage_saml",
  61. "manage_security",
  62. "manage_slm",
  63. "manage_token",
  64. "manage_watcher",
  65. "monitor",
  66. "monitor_data_frame_transforms",
  67. "monitor_ml",
  68. "monitor_rollup",
  69. "monitor_watcher",
  70. "none",
  71. "read_ccr",
  72. "read_ilm",
  73. "read_slm",
  74. "transport_client"
  75. ],
  76. "index" : [
  77. "all",
  78. "create",
  79. "create_index",
  80. "delete",
  81. "delete_index",
  82. "index",
  83. "manage",
  84. "manage_follow_index",
  85. "manage_ilm",
  86. "manage_leader_index",
  87. "monitor",
  88. "none",
  89. "read",
  90. "read_cross_cluster",
  91. "view_index_metadata",
  92. "write"
  93. ]
  94. }
  95. --------------------------------------------------
  96. // TESTRESPONSE