Warn & Disallow Creating Role with Existing Name (#132218)

* Adds inline warning (name focus/onBlur) and toast warning (saveRole) when attempting to create a role with a name that already exists.
Disallows creating a role with a name that already exists.
Event handling efficiency needs review.

* Updated API documentation.
Implemented unit and functional tests.

* Added name compare to throttle GET request from onBlur for efficiency.

* Reorganized functional and unit tests. Improved UI logic and presentation.

* Update x-pack/plugins/security/server/routes/authorization/roles/put.test.ts

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Update x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
This commit is contained in:
Jeramy Soucy 2022-05-25 17:34:41 +02:00 committed by GitHub
parent 4317eabbea
commit cb403a6fa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 219 additions and 5 deletions

View file

@ -51,12 +51,21 @@ To use the create or update role API, you must have the `manage_security` cluste
To grant access to all spaces, set to `["*"]`, or omit the value.
=====
[[role-management-api-put-query-params]]
==== Query parameters
`createOnly`::
(Optional, boolean) When `true`, will prevent overwriting the role if it already exists.
[[role-management-api-put-response-codes]]
==== Response code
`204`::
Indicates a successful call.
'409'::
When `createOnly` is true, indicates a conflict with an existing role.
==== Examples
Grant access to various features in all spaces: