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

[8.x] [Stream] Fix callout privileges (#198030) #198262

Open
wants to merge 2 commits into
base: 8.x
Choose a base branch
from

Conversation

mohamedhamed-ahmed
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

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)
@mohamedhamed-ahmed mohamedhamed-ahmed enabled auto-merge (squash) October 30, 2024 09:03
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Oct 30, 2024
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 30, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: e0e8dd2
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-198262-e0e8dd235d3e

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
infra 1.7MB 1.7MB +162.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
infra 54.1KB 54.4KB +373.0B

History

Copy link
Contributor

@awahab07 awahab07 left a 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
)
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
);
),
distinctUntilChanged()
);
// `import { map, distinctUntilChanged } from 'rxjs';`

to avoid duplicate values. Otherwise the subscription may be called multiple of times resulting in the following:

198262-multi-nav-02

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.

if (!(discover?.show && fleet?.read && logs?.show)) {

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants