Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.10] [Security Solution] Fixes Assistant Connector and Actions RBAC…
… Flow (#164382) (#164645) # Backport This will backport the following commits from `main` to `8.10`: - [[Security Solution] Fixes Assistant Connector and Actions RBAC Flow (#164382)](#164382) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Garrett Spong","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-23T21:22:39Z","message":"[Security Solution] Fixes Assistant Connector and Actions RBAC Flow (#164382)\n\n## Summary\r\n\r\nResolves #159374 by ensuring\r\nthat if a user doesn't have the appropriate `Connectors & Actions`\r\nprivileges, they will be shown the appropriate messaging and any UI\r\ncontrols for adding Connectors will be disabled or unavailable.\r\n\r\n#### Connectors and Actions `NONE` or Connectors and Actions `READ` if\r\n*NO* existing connectors exist:\r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/d9535ae9-a31e-499b-9b18-6004e3db64de\"\r\n/>\r\n</p> \r\n\r\n#### Connectors and Actions `READ` if existing connector count > 0:\r\n\r\n`Add Connector...` option isn't available:\r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/bd6a06a7-ffa2-4cfc-a2b7-844da99cb171\"\r\n/>\r\n</p> \r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/4681086e-1015-45b9-9afb-ff604c52cd38\"\r\n/>\r\n</p> \r\n\r\n\r\n\r\nAlso addresses:\r\n\r\n* Fixes disabled state of header connector selector for setup flows.\r\n* Adds `AssistantAvailability` interface to `AssistantContext` for\r\nexposing ui feature controls like `Connectors & Actions` privileges.\r\n* Hides `Add new connector...` option if user doesn't have `ALL`\r\n`Connectors & Actions` privileges.\r\n* Hoists dependencies from `assistant/index.tsx` to `connector_setup` as\r\nit was already fetching dependencies from `useAssistantContext`.\r\n\r\nNote: `ConnectorButton` and `ConnectorMissingCallout` should probably be\r\ncombined into a single component and show appropriate messaging given\r\nthe user's `Connectors & Actions` privileges. I kept them separate for\r\nnow as to not modify the control flow around the two components (till we\r\ncan further refactor `assistant/index.tsx`), which means the missing\r\nconnector callout is sort of doing double duty at the moment.\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [X] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [X] [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","sha":"db7ac1bb417a4c84d29e1d7e9e831bdaf650358c","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team: SecuritySolution","Feature:Elastic AI Assistant","v8.10.0","v8.11.0"],"number":164382,"url":"https://github.com/elastic/kibana/pull/164382","mergeCommit":{"message":"[Security Solution] Fixes Assistant Connector and Actions RBAC Flow (#164382)\n\n## Summary\r\n\r\nResolves #159374 by ensuring\r\nthat if a user doesn't have the appropriate `Connectors & Actions`\r\nprivileges, they will be shown the appropriate messaging and any UI\r\ncontrols for adding Connectors will be disabled or unavailable.\r\n\r\n#### Connectors and Actions `NONE` or Connectors and Actions `READ` if\r\n*NO* existing connectors exist:\r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/d9535ae9-a31e-499b-9b18-6004e3db64de\"\r\n/>\r\n</p> \r\n\r\n#### Connectors and Actions `READ` if existing connector count > 0:\r\n\r\n`Add Connector...` option isn't available:\r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/bd6a06a7-ffa2-4cfc-a2b7-844da99cb171\"\r\n/>\r\n</p> \r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/4681086e-1015-45b9-9afb-ff604c52cd38\"\r\n/>\r\n</p> \r\n\r\n\r\n\r\nAlso addresses:\r\n\r\n* Fixes disabled state of header connector selector for setup flows.\r\n* Adds `AssistantAvailability` interface to `AssistantContext` for\r\nexposing ui feature controls like `Connectors & Actions` privileges.\r\n* Hides `Add new connector...` option if user doesn't have `ALL`\r\n`Connectors & Actions` privileges.\r\n* Hoists dependencies from `assistant/index.tsx` to `connector_setup` as\r\nit was already fetching dependencies from `useAssistantContext`.\r\n\r\nNote: `ConnectorButton` and `ConnectorMissingCallout` should probably be\r\ncombined into a single component and show appropriate messaging given\r\nthe user's `Connectors & Actions` privileges. I kept them separate for\r\nnow as to not modify the control flow around the two components (till we\r\ncan further refactor `assistant/index.tsx`), which means the missing\r\nconnector callout is sort of doing double duty at the moment.\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [X] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [X] [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","sha":"db7ac1bb417a4c84d29e1d7e9e831bdaf650358c"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164382","number":164382,"mergeCommit":{"message":"[Security Solution] Fixes Assistant Connector and Actions RBAC Flow (#164382)\n\n## Summary\r\n\r\nResolves #159374 by ensuring\r\nthat if a user doesn't have the appropriate `Connectors & Actions`\r\nprivileges, they will be shown the appropriate messaging and any UI\r\ncontrols for adding Connectors will be disabled or unavailable.\r\n\r\n#### Connectors and Actions `NONE` or Connectors and Actions `READ` if\r\n*NO* existing connectors exist:\r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/d9535ae9-a31e-499b-9b18-6004e3db64de\"\r\n/>\r\n</p> \r\n\r\n#### Connectors and Actions `READ` if existing connector count > 0:\r\n\r\n`Add Connector...` option isn't available:\r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/bd6a06a7-ffa2-4cfc-a2b7-844da99cb171\"\r\n/>\r\n</p> \r\n\r\n<p align=\"center\">\r\n<img width=\"500\"\r\nsrc=\"https://github.com/elastic/kibana/assets/2946766/4681086e-1015-45b9-9afb-ff604c52cd38\"\r\n/>\r\n</p> \r\n\r\n\r\n\r\nAlso addresses:\r\n\r\n* Fixes disabled state of header connector selector for setup flows.\r\n* Adds `AssistantAvailability` interface to `AssistantContext` for\r\nexposing ui feature controls like `Connectors & Actions` privileges.\r\n* Hides `Add new connector...` option if user doesn't have `ALL`\r\n`Connectors & Actions` privileges.\r\n* Hoists dependencies from `assistant/index.tsx` to `connector_setup` as\r\nit was already fetching dependencies from `useAssistantContext`.\r\n\r\nNote: `ConnectorButton` and `ConnectorMissingCallout` should probably be\r\ncombined into a single component and show appropriate messaging given\r\nthe user's `Connectors & Actions` privileges. I kept them separate for\r\nnow as to not modify the control flow around the two components (till we\r\ncan further refactor `assistant/index.tsx`), which means the missing\r\nconnector callout is sort of doing double duty at the moment.\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [X] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [X] [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","sha":"db7ac1bb417a4c84d29e1d7e9e831bdaf650358c"}}]}] BACKPORT--> Co-authored-by: Garrett Spong <[email protected]>
- Loading branch information