delete-role-mappings.asciidoc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [role="xpack"]
  2. [[security-api-delete-role-mapping]]
  3. === Delete role mappings API
  4. ++++
  5. <titleabbrev>Delete role mappings</titleabbrev>
  6. ++++
  7. Removes role mappings.
  8. [[security-api-delete-role-mapping-request]]
  9. ==== {api-request-title}
  10. `DELETE /_security/role_mapping/<name>`
  11. [[security-api-delete-role-mapping-prereqs]]
  12. ==== {api-prereq-title}
  13. * To use this API, you must have at least the `manage_security` cluster privilege.
  14. [[security-api-delete-role-mapping-desc]]
  15. ==== {api-description-title}
  16. Role mappings define which roles are assigned to each user. For more information,
  17. see <<mapping-roles>>.
  18. The role mapping APIs are generally the preferred way to manage role mappings
  19. rather than using <<mapping-roles-file,role mapping files>>.
  20. The delete role mappings API cannot remove role mappings that are defined
  21. in role mapping files.
  22. [[security-api-delete-role-mapping-path-params]]
  23. ==== {api-path-parms-title}
  24. `name`::
  25. (string) The distinct name that identifies the role mapping. The name is
  26. used solely as an identifier to facilitate interaction via the API; it does
  27. not affect the behavior of the mapping in any way.
  28. [[security-api-delete-role-mapping-example]]
  29. ==== {api-examples-title}
  30. The following example delete a role mapping:
  31. [source,console]
  32. --------------------------------------------------
  33. DELETE /_security/role_mapping/mapping1
  34. --------------------------------------------------
  35. // TEST[setup:role_mapping]
  36. If the mapping is successfully deleted, the request returns `{"found": true}`.
  37. Otherwise, `found` is set to false.
  38. [source,console-result]
  39. --------------------------------------------------
  40. {
  41. "found" : true
  42. }
  43. --------------------------------------------------