-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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.x] [Stream] Fix callout privileges (#198030) #198262
base: 8.x
Are you sure you want to change the base?
[8.x] [Stream] Fix callout privileges (#198030) #198262
Conversation
closes elastic#192062 This PR adds privileges checks for `Logs Explorerer` it checks for `Discover & Fleet` privileges before allowing the user access to `Logs Explorer`. Clicking on the `Logs` tab from the side nav defaults to `Stream`, as long as its not depricated, in case the user doesn't have access to `Logs Explorer` https://github.com/user-attachments/assets/a4105ec0-7681-40ee-b2fd-e39b9c178dcf (cherry picked from commit dbfd4f0)
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
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.
LGTM
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History |
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.
Disabling and then enabling the Logs Stream UI could trigger multiple Logs Explorer nav entries.
capabilities.discover?.show && | ||
capabilities.fleet?.read | ||
) | ||
); |
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.
); | |
), | |
distinctUntilChanged() | |
); |
// `import { map, distinctUntilChanged } from 'rxjs';`
to avoid duplicate values. Otherwise the subscription may be called multiple of times resulting in the following:
The above is observed on 8.x
branch and wasn't happening on main
, but would be ideal to adjust everywhere.
Also see if we need capabilities.discover?.show && capabilities.fleet?.read
explicitly here as the following already includes both.
kibana/x-pack/plugins/observability_solution/observability_logs_explorer/public/plugin.ts
Line 150 in 3feea7b
if (!(discover?.show && fleet?.read && logs?.show)) { |
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.
yes the check is still needed as its the one responsible for pushing the entry to the side nav
Backport
This will backport the following commits from
main
to8.x
:Questions ?
Please refer to the Backport tool documentation