-
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
feat: disable buttons to try sample data or upload a file for a read-only user #197991
Draft
paulinashakirova
wants to merge
3
commits into
elastic:main
Choose a base branch
from
paulinashakirova:138547-disable-sample-data-readonly-user
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
144 changes: 144 additions & 0 deletions
144
src/plugins/home/public/application/components/add_data/__snapshots__/add_data.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't have a lot of experience with capabilities, but I don't think this is a good flag for this readonly state.
rulesSettings.writeFlappingSettingsUI
seem to be a alerting frameworkspecific capability and we shouldn't use it outside of it.
I think this is the right direction, but I don't know if there is an existing capability that could work for us here (need to look for it) otherwise we might have to register a new one
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 the the sampel data, I think
application.capabilities.indexPatterns.save
would be a good capability. To create sample data you'd have to be able to create a (dataview) so it would at least be a required condition.for the
fileDataViz
not sure. haven't worked with it before - need review the code an see if there anything we could useThere 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.
Also the screenshot from the issue #138547 is pointing out an issue on different component
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.
In the comment below the body of the issue there was this suggestion
#138547 (comment), which made sense, so I followed it.
Do you think it is less beneficial to disable the whole accordion?
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.
I was thinking a bit more about the issue and did some testing. I think the issue is not that simple and we will need to find some middleground between the effort and the result. Some investigation is needed, here are some pointers:
add_data
component is not enough, because there are other ways to navigate toapp/home#/tutorial_directory/sampleData
page . Also maybe we shouldn't disable those buttons inadd_data
component at all , because there is an external link from that page to a demo environment that isn't restricted by permissionsapplication.capabilities.savedObjectsManagement.edit
is a good guess for checking if the user is able to add sample data, but it might give false positives and negatives. Ideally we should investigate exact permissions that are needed for adding sample data and then decide what to do with them. This can be done by reviewing the code, analysing internal errors and trial and error.kibana/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js
Lines 72 to 75 in 3177b03
It might be that after the investigation we will return to a simple fix like we currently have. But to do it with confidence we'd need to understand how it all works end to end
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.
Thank you for your detailed review.
I will convert this PR to draft for now, since it doesn't fall into the "papercut" category.
Might reopen in the future.