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

[Fleet] Disable button in logstash output based on correct privileges #195210

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

criamico
Copy link
Contributor

@criamico criamico commented Oct 7, 2024

Fixes #191951

Summary

Disable button in logstash output based on correct privileges.

Testing

  • Enable feature flag subfeaturePrivileges
  • Follow testing steps in above ticket
    The button "view steps" in logstash output should be disabled if role doesn'thave fleet.allSettings privileges

Screenshot 2024-10-07 at 12 03 25

Screenshot 2024-10-07 at 14 48 45

Checklist

@criamico criamico self-assigned this Oct 7, 2024
@criamico criamico added Team:Fleet Team label for Observability Data Collection Fleet team release_note:skip Skip the PR/issue when compiling release notes 8.16 candidate backport:version Backport to applied version labels v8.16.0 and removed 8.16 candidate labels Oct 7, 2024
@criamico criamico marked this pull request as ready for review October 7, 2024 10:07
@criamico criamico requested a review from a team as a code owner October 7, 2024 10:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -76,7 +77,7 @@ const CollapsibleCallout: React.FunctionComponent<EuiCallOutProps> = ({ children
/>
</EuiButton>
) : (
<EuiButton onClick={() => setIsOpen(true)} fill={true}>
<EuiButton onClick={() => setIsOpen(true)} fill={true} disabled={!hasAllSettings}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I added a MissingPrivilegesToolTip in #195185 that you can use to display a tooltip on why it's disabled

@criamico
Copy link
Contributor Author

criamico commented Oct 7, 2024

@elasticmachine merge upstream

@criamico
Copy link
Contributor Author

criamico commented Oct 7, 2024

@elasticmachine merge upstream

@criamico criamico enabled auto-merge (squash) October 7, 2024 12:51
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

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
fleet 1.7MB 1.7MB +306.0B

History

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

cc @criamico

@criamico criamico merged commit 71c8d6f into elastic:main Oct 7, 2024
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11218254372

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 7, 2024
…elastic#195210)

Fixes elastic#191951

## Summary
Disable button in logstash output based on correct privileges.

### Testing
- Enable feature flag `subfeaturePrivileges`
- Follow testing steps in above ticket
The button "view steps" in logstash output should be disabled if role
doesn'thave `fleet.allSettings` privileges

![Screenshot 2024-10-07 at 12 03
25](https://github.com/user-attachments/assets/4933fa97-612c-4ddf-abcb-9838b110df09)

![Screenshot 2024-10-07 at 14 48
45](https://github.com/user-attachments/assets/0155480a-a7c5-4274-ab95-57a867b2a1cc)

### Checklist

- [ ] [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

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 71c8d6f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 7, 2024
…ileges (#195210) (#195275)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fleet] Disable button in logstash output based on correct privileges
(#195210)](#195210)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cristina
Amico","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T14:57:08Z","message":"[Fleet]
Disable button in logstash output based on correct privileges
(#195210)\n\nFixes
https://github.com/elastic/kibana/issues/191951\r\n\r\n##
Summary\r\nDisable button in logstash output based on correct
privileges.\r\n\r\n### Testing \r\n- Enable feature flag
`subfeaturePrivileges`\r\n- Follow testing steps in above ticket\r\nThe
button \"view steps\" in logstash output should be disabled if
role\r\ndoesn'thave `fleet.allSettings` privileges\r\n\r\n![Screenshot
2024-10-07 at 12
03\r\n25](https://github.com/user-attachments/assets/4933fa97-612c-4ddf-abcb-9838b110df09)\r\n\r\n![Screenshot
2024-10-07 at 14
48\r\n45](https://github.com/user-attachments/assets/0155480a-a7c5-4274-ab95-57a867b2a1cc)\r\n\r\n\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\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"71c8d6fddcb5abd32ece23c0b0c74a766691ca34","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","v8.16.0","backport:version"],"title":"[Fleet]
Disable button in logstash output based on correct
privileges","number":195210,"url":"https://github.com/elastic/kibana/pull/195210","mergeCommit":{"message":"[Fleet]
Disable button in logstash output based on correct privileges
(#195210)\n\nFixes
https://github.com/elastic/kibana/issues/191951\r\n\r\n##
Summary\r\nDisable button in logstash output based on correct
privileges.\r\n\r\n### Testing \r\n- Enable feature flag
`subfeaturePrivileges`\r\n- Follow testing steps in above ticket\r\nThe
button \"view steps\" in logstash output should be disabled if
role\r\ndoesn'thave `fleet.allSettings` privileges\r\n\r\n![Screenshot
2024-10-07 at 12
03\r\n25](https://github.com/user-attachments/assets/4933fa97-612c-4ddf-abcb-9838b110df09)\r\n\r\n![Screenshot
2024-10-07 at 14
48\r\n45](https://github.com/user-attachments/assets/0155480a-a7c5-4274-ab95-57a867b2a1cc)\r\n\r\n\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\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"71c8d6fddcb5abd32ece23c0b0c74a766691ca34"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195210","number":195210,"mergeCommit":{"message":"[Fleet]
Disable button in logstash output based on correct privileges
(#195210)\n\nFixes
https://github.com/elastic/kibana/issues/191951\r\n\r\n##
Summary\r\nDisable button in logstash output based on correct
privileges.\r\n\r\n### Testing \r\n- Enable feature flag
`subfeaturePrivileges`\r\n- Follow testing steps in above ticket\r\nThe
button \"view steps\" in logstash output should be disabled if
role\r\ndoesn'thave `fleet.allSettings` privileges\r\n\r\n![Screenshot
2024-10-07 at 12
03\r\n25](https://github.com/user-attachments/assets/4933fa97-612c-4ddf-abcb-9838b110df09)\r\n\r\n![Screenshot
2024-10-07 at 14
48\r\n45](https://github.com/user-attachments/assets/0155480a-a7c5-4274-ab95-57a867b2a1cc)\r\n\r\n\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\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"71c8d6fddcb5abd32ece23c0b0c74a766691ca34"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Cristina Amico <[email protected]>
@criamico criamico deleted the 191951_rbac_fixes branch October 8, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet]: View Steps and Generate API is not disabled on editing Logstash output for user role Settings: Read
6 participants