Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
albertzaharovits committed Jul 5, 2024
1 parent 9c12a56 commit fbfe51a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/reference/rest-api/security/get-roles.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ API cannot retrieve roles that are defined in roles files.
A successful call returns an array of roles with the JSON representation of the
role. The returned role format is a simple extension of the <<defining-roles,role definition>> format,
only adding an extra field `transient_metadata.enabled`.
This field is `false` in case the role is automatically disabled, for e.g. in case the license
This field is `false` in case the role is automatically disabled, for example when the license
level does not allow some permissions that the role grants.

[[security-api-get-role-response-codes]]
Expand Down
18 changes: 8 additions & 10 deletions docs/reference/rest-api/security/query-role.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ You can query the following values associated with a role.
[%collapsible%open]
====
`name`::
The <<security-api-put-role-path-params,name>> of the role, which is internally indexed as a keyword.
(keyword) The <<security-api-put-role-path-params,name>> of the role.
`description`::
The <<defining-roles,description>> of the role, which is internally indexed as a text.
(text) The <<defining-roles,description>> of the role.
`metadata`::
Metadata field associated with the <<defining-roles,role>>, such as `metadata.app_tag`.
(flattened) Metadata field associated with the <<defining-roles,role>>, such as `metadata.app_tag`.
Note that metadata is internally indexed as a <<flattened,flattened>> field type.
This means that all sub-fields act like `keyword` fields when querying and sorting.
It also implies that it is not possible to refer to a subset of metadata fields using wildcard patterns,
Expand All @@ -65,16 +65,15 @@ Lastly, all the metadata fields can be searched together when simply mentioning
`applications`::
The list of <<roles-application-priv,application privileges>> that the role grants.
These are all internally indexed as keywords.
`application`:::
The name of the application associated to the privileges and resources.
(keyword) The name of the application associated to the privileges and resources.
`privileges`:::
The names of the privileges that the role grants.
(keyword) The names of the privileges that the role grants.
`resources`:::
The resources to which the privileges apply.
(keyword) The resources to which the privileges apply.
====

Expand Down Expand Up @@ -115,15 +114,14 @@ A list of roles that match the query.
The returned role format is an extension of the <<defining-roles,role definition>> format.
It adds the `transient_metadata.enabled` and the `_sort` fields.
`transient_metadata.enabled` is set to `false` in case the role is automatically disabled,
for e.g. because the role grants privileges that are not allowed by the installed license.
for example when the role grants privileges that are not allowed by the installed license.
`_sort` is present when the search query sorts on some field.
It contains the array of values that have been used for sorting.

[[security-api-query-role-example]]
==== {api-examples-title}

The following request lists all roles, sorted by the role name.
This assumes you have the `read_security` <<privileges-list-cluster,privilege>>:
The following request lists all roles, sorted by the role name:

[source,console]
----
Expand Down

0 comments on commit fbfe51a

Please sign in to comment.