Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.13] [Security Solution] Fix infinite loading state on Add Rules pa…
…ge for users with `Security: Read` permissions (#178005) (#178603) # Backport This will backport the following commits from `main` to `8.13`: - [[Security Solution] Fix infinite loading state on Add Rules page for users with `Security: Read` permissions (#178005)](#178005) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Juan Pablo Djeredjian","email":"jpdjeredjian@gmail.com"},"sourceCommit":{"committedDate":"2024-03-12T23:16:20Z","message":"[Security Solution] Fix infinite loading state on Add Rules page for users with `Security: Read` permissions (#178005)\n\nFixes: https://github.com/elastic/kibana/issues/161543\r\n\r\n## Summary\r\n\r\nSolves edge case of a `Security: Read` user visiting the Add Rules page\r\nbefore a user with permissions does (therefore the space has no\r\npermissions). This would cause the `/install/_review` call to never\r\nhappen, and the page to get stuck in an infinite loading state.\r\n\r\n- Encapsulates logic to calculate if the `/install/_review` endpoint\r\nshould be called\r\n- Allows `Security: Read` users to make the endpoint call\r\n`/install/_review`\r\n- The \"All Elastic rules already installed\" screen is shown to users in\r\nthis edge case.\r\n- Adds frontend integration tests to Add Tables page\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed","sha":"b8396f48ce05f2c16d2fd9890f921260dd6a5a7d","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","v8.13.0","v8.14.0"],"number":178005,"url":"https://github.com/elastic/kibana/pull/178005","mergeCommit":{"message":"[Security Solution] Fix infinite loading state on Add Rules page for users with `Security: Read` permissions (#178005)\n\nFixes: https://github.com/elastic/kibana/issues/161543\r\n\r\n## Summary\r\n\r\nSolves edge case of a `Security: Read` user visiting the Add Rules page\r\nbefore a user with permissions does (therefore the space has no\r\npermissions). This would cause the `/install/_review` call to never\r\nhappen, and the page to get stuck in an infinite loading state.\r\n\r\n- Encapsulates logic to calculate if the `/install/_review` endpoint\r\nshould be called\r\n- Allows `Security: Read` users to make the endpoint call\r\n`/install/_review`\r\n- The \"All Elastic rules already installed\" screen is shown to users in\r\nthis edge case.\r\n- Adds frontend integration tests to Add Tables page\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed","sha":"b8396f48ce05f2c16d2fd9890f921260dd6a5a7d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/178588","number":178588,"state":"OPEN"},{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/178005","number":178005,"mergeCommit":{"message":"[Security Solution] Fix infinite loading state on Add Rules page for users with `Security: Read` permissions (#178005)\n\nFixes: https://github.com/elastic/kibana/issues/161543\r\n\r\n## Summary\r\n\r\nSolves edge case of a `Security: Read` user visiting the Add Rules page\r\nbefore a user with permissions does (therefore the space has no\r\npermissions). This would cause the `/install/_review` call to never\r\nhappen, and the page to get stuck in an infinite loading state.\r\n\r\n- Encapsulates logic to calculate if the `/install/_review` endpoint\r\nshould be called\r\n- Allows `Security: Read` users to make the endpoint call\r\n`/install/_review`\r\n- The \"All Elastic rules already installed\" screen is shown to users in\r\nthis edge case.\r\n- Adds frontend integration tests to Add Tables page\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed","sha":"b8396f48ce05f2c16d2fd9890f921260dd6a5a7d"}}]}] BACKPORT--> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information