-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Notes] - disable add note button in flyout is user lacks privileges #201707
[Security Solution][Notes] - disable add note button in flyout is user lacks privileges #201707
Conversation
…r lacks privileges
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
💚 Build Succeeded
Metrics [docs]Async chunks
|
> | ||
{ADD_NOTE_BUTTON} | ||
</EuiButtonEmpty> | ||
<>{kibanaSecuritySolutionsPrivileges.crud ? addNoteButton : getEmptyTagValue()}</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💅 Consider pulling this into its own variable to make it more readable:
const canAddNotes = kibanaSecuritySolutionsPrivileges.crud;
(...)
canAddNotes ? addNoteButton : emptyTag()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this one I actually personally think not extracting is more readable. I can right away see the condition instead of having to navigate to another place in the code...
Starting backport for target branches: 8.17 https://github.com/elastic/kibana/actions/runs/12032872774 |
…r lacks privileges (elastic#201707) ## Summary This PR fixes a small issue where users could click on the add button in the alert details flyout even if they did not have the correct privileges. When the user has the correct privileges, the UI does not change. In the flyout: - if no notes have previously been created for the document, we show a `Add note` button - if some notes have previously been created for the document, we show the number of notes and a plus button icon https://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001 When the user does not have the correct privileges, the flyout UI now shows the following: - if no notes have previously been created for the document, we show a `-` - if one or more notes have been created for the document, we show the number of notes followed by a `View note(s)` button, that - when clicked - opens the left panel for the user to view the notes https://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673 elastic#201702 ### Checklist - [ ] 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) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit c7b5b35)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…r lacks privileges (elastic#201707) ## Summary This PR fixes a small issue where users could click on the add button in the alert details flyout even if they did not have the correct privileges. When the user has the correct privileges, the UI does not change. In the flyout: - if no notes have previously been created for the document, we show a `Add note` button - if some notes have previously been created for the document, we show the number of notes and a plus button icon https://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001 When the user does not have the correct privileges, the flyout UI now shows the following: - if no notes have previously been created for the document, we show a `-` - if one or more notes have been created for the document, we show the number of notes followed by a `View note(s)` button, that - when clicked - opens the left panel for the user to view the notes https://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673 elastic#201702 ### Checklist - [ ] 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) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
… is user lacks privileges (#201707) (#201802) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution][Notes] - disable add note button in flyout is user lacks privileges (#201707)](#201707) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Philippe Oberti","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-26T14:36:47Z","message":"[Security Solution][Notes] - disable add note button in flyout is user lacks privileges (#201707)\n\n## Summary\r\n\r\nThis PR fixes a small issue where users could click on the add button in\r\nthe alert details flyout even if they did not have the correct\r\nprivileges.\r\n\r\nWhen the user has the correct privileges, the UI does not change. In the\r\nflyout:\r\n- if no notes have previously been created for the document, we show a\r\n`Add note` button\r\n- if some notes have previously been created for the document, we show\r\nthe number of notes and a plus button icon\r\n\r\n\r\nhttps://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001\r\n\r\nWhen the user does not have the correct privileges, the flyout UI now\r\nshows the following:\r\n- if no notes have previously been created for the document, we show a\r\n`-`\r\n- if one or more notes have been created for the document, we show the\r\nnumber of notes followed by a `View note(s)` button, that - when clicked\r\n- opens the left panel for the user to view the notes\r\n\r\n\r\nhttps://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673\r\n\r\nhttps://github.com//issues/201702\r\n\r\n### Checklist\r\n\r\n- [ ] 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- [ ] [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":"c7b5b35b199611741993e124811352472e8323f2","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Threat Hunting:Investigations","backport:version","v8.17.0"],"title":"[Security Solution][Notes] - disable add note button in flyout is user lacks privileges","number":201707,"url":"https://github.com/elastic/kibana/pull/201707","mergeCommit":{"message":"[Security Solution][Notes] - disable add note button in flyout is user lacks privileges (#201707)\n\n## Summary\r\n\r\nThis PR fixes a small issue where users could click on the add button in\r\nthe alert details flyout even if they did not have the correct\r\nprivileges.\r\n\r\nWhen the user has the correct privileges, the UI does not change. In the\r\nflyout:\r\n- if no notes have previously been created for the document, we show a\r\n`Add note` button\r\n- if some notes have previously been created for the document, we show\r\nthe number of notes and a plus button icon\r\n\r\n\r\nhttps://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001\r\n\r\nWhen the user does not have the correct privileges, the flyout UI now\r\nshows the following:\r\n- if no notes have previously been created for the document, we show a\r\n`-`\r\n- if one or more notes have been created for the document, we show the\r\nnumber of notes followed by a `View note(s)` button, that - when clicked\r\n- opens the left panel for the user to view the notes\r\n\r\n\r\nhttps://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673\r\n\r\nhttps://github.com//issues/201702\r\n\r\n### Checklist\r\n\r\n- [ ] 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- [ ] [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":"c7b5b35b199611741993e124811352472e8323f2"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201707","number":201707,"mergeCommit":{"message":"[Security Solution][Notes] - disable add note button in flyout is user lacks privileges (#201707)\n\n## Summary\r\n\r\nThis PR fixes a small issue where users could click on the add button in\r\nthe alert details flyout even if they did not have the correct\r\nprivileges.\r\n\r\nWhen the user has the correct privileges, the UI does not change. In the\r\nflyout:\r\n- if no notes have previously been created for the document, we show a\r\n`Add note` button\r\n- if some notes have previously been created for the document, we show\r\nthe number of notes and a plus button icon\r\n\r\n\r\nhttps://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001\r\n\r\nWhen the user does not have the correct privileges, the flyout UI now\r\nshows the following:\r\n- if no notes have previously been created for the document, we show a\r\n`-`\r\n- if one or more notes have been created for the document, we show the\r\nnumber of notes followed by a `View note(s)` button, that - when clicked\r\n- opens the left panel for the user to view the notes\r\n\r\n\r\nhttps://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673\r\n\r\nhttps://github.com//issues/201702\r\n\r\n### Checklist\r\n\r\n- [ ] 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- [ ] [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":"c7b5b35b199611741993e124811352472e8323f2"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Philippe Oberti <[email protected]>
…r lacks privileges (elastic#201707) ## Summary This PR fixes a small issue where users could click on the add button in the alert details flyout even if they did not have the correct privileges. When the user has the correct privileges, the UI does not change. In the flyout: - if no notes have previously been created for the document, we show a `Add note` button - if some notes have previously been created for the document, we show the number of notes and a plus button icon https://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001 When the user does not have the correct privileges, the flyout UI now shows the following: - if no notes have previously been created for the document, we show a `-` - if one or more notes have been created for the document, we show the number of notes followed by a `View note(s)` button, that - when clicked - opens the left panel for the user to view the notes https://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673 elastic#201702 ### Checklist - [ ] 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) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…r lacks privileges (elastic#201707) ## Summary This PR fixes a small issue where users could click on the add button in the alert details flyout even if they did not have the correct privileges. When the user has the correct privileges, the UI does not change. In the flyout: - if no notes have previously been created for the document, we show a `Add note` button - if some notes have previously been created for the document, we show the number of notes and a plus button icon https://github.com/user-attachments/assets/d9a27b70-99b1-4562-8224-4f5c2f25b001 When the user does not have the correct privileges, the flyout UI now shows the following: - if no notes have previously been created for the document, we show a `-` - if one or more notes have been created for the document, we show the number of notes followed by a `View note(s)` button, that - when clicked - opens the left panel for the user to view the notes https://github.com/user-attachments/assets/8ebe8bf5-16ab-4652-b4d3-47507c2d3673 elastic#201702 ### Checklist - [ ] 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) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
Summary
This PR fixes a small issue where users could click on the add button in the alert details flyout even if they did not have the correct privileges.
When the user has the correct privileges, the UI does not change. In the flyout:
Add note
buttonScreen.Recording.2024-11-25.at.6.16.57.PM.mov
When the user does not have the correct privileges, the flyout UI now shows the following:
-
View note(s)
button, that - when clicked - opens the left panel for the user to view the notesScreen.Recording.2024-11-25.at.6.18.00.PM.mov
#201702
Checklist