Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.11] [RAM] Enable read-only users to access rules (#167003) #168259

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.11:

Questions ?

Please refer to the Backport tool documentation

Closes elastic#166613

## Summary

Enables users with read privilege on `Stack rules` to see the rules
table and the rule detail page without editing capabilities. Before:

![image](https://github.com/elastic/kibana/assets/18363145/a377819f-b140-41a4-aad9-9f5a5d779d63)

After:

![image](https://github.com/elastic/kibana/assets/18363145/0c1bbf08-0f7b-4778-ae3e-062b0bd49c8f)

In case of empty rules lists, the prompt "Create your first rule" was
shown, even to users without create permissions:

![image](https://github.com/elastic/kibana/assets/18363145/3beaadb5-7b54-473e-9daa-e96c79e5a9f4)

To avoid confusion, read-only users now see the empty table instead:

![image](https://github.com/elastic/kibana/assets/18363145/f35d212a-bc3e-4ee6-a3af-605966efced9)

In the rule detail page, users without access to `Actions and
Connectors` now see a missing privileges message under `Actions` in the
details panel instead of `No actions` and a `Forbidden` error toast.

![image](https://github.com/elastic/kibana/assets/18363145/7d3edeae-3cd0-44c5-be2b-57ba4b54f69e)

Finally, the original missing authorization prompt now shows "read"
instead of "create":

![image](https://github.com/elastic/kibana/assets/18363145/f88b492d-3b20-41ac-a7c7-3cdd7f971ee5)

## To test

- Create an Elasticsearch query rule
- Create a Role with read privilege granted in `Stack rules` (under
Kibana > Management) and assign it to a user
- Create a test user with the created role
- Log in as the test user
- Navigate to Stack Management > Rules
- Check that the rules table is visible, with create and update actions
disabled

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)

---------

Co-authored-by: Xavier Mouligneau <[email protected]>
(cherry picked from commit e49628a)
@kibanamachine kibanamachine merged commit af03cbf into elastic:8.11 Oct 6, 2023
3 checks passed
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
triggersActionsUi 1.4MB 1.4MB +704.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @umbopepato

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants