elasticsearch/docs/reference/rest-api/security/delete-role-mappings.asciidoc
James Rodewig 255c9a7f95
[DOCS] Move x-pack docs to docs/reference dir (#99209)
**Problem:**
For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. 

**Solution:**
- Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory
- Update doc snippet tests to use security

Rel: https://github.com/elastic/platform-docs-team/issues/208
2023-09-12 14:53:41 -04:00

59 lines
1.7 KiB
Text

[role="xpack"]
[[security-api-delete-role-mapping]]
=== Delete role mappings API
++++
<titleabbrev>Delete role mappings</titleabbrev>
++++
Removes role mappings.
[[security-api-delete-role-mapping-request]]
==== {api-request-title}
`DELETE /_security/role_mapping/<name>`
[[security-api-delete-role-mapping-prereqs]]
==== {api-prereq-title}
* To use this API, you must have at least the `manage_security` cluster privilege.
[[security-api-delete-role-mapping-desc]]
==== {api-description-title}
Role mappings define which roles are assigned to each user. For more information,
see <<mapping-roles>>.
The role mapping APIs are generally the preferred way to manage role mappings
rather than using <<mapping-roles-file,role mapping files>>.
The delete role mappings API cannot remove role mappings that are defined
in role mapping files.
[[security-api-delete-role-mapping-path-params]]
==== {api-path-parms-title}
`name`::
(string) The distinct name that identifies the role mapping. The name is
used solely as an identifier to facilitate interaction via the API; it does
not affect the behavior of the mapping in any way.
[[security-api-delete-role-mapping-example]]
==== {api-examples-title}
The following example delete a role mapping:
[source,console]
--------------------------------------------------
DELETE /_security/role_mapping/mapping1
--------------------------------------------------
// TEST[setup:role_mapping]
If the mapping is successfully deleted, the request returns `{"found": true}`.
Otherwise, `found` is set to false.
[source,console-result]
--------------------------------------------------
{
"found" : true
}
--------------------------------------------------