feat(ui): Disable user selection of data when user does not have export permissions#29654
feat(ui): Disable user selection of data when user does not have export permissions#29654MialLewis wants to merge 26 commits intoapache:masterfrom
Conversation
|
@rusackas I'm pinging you as you merged a related PR #28429. I'm working to disable user select for data, which is required for our sensitive data. The more blockers we can put in the place of data export the better, even if they can be circumvented. We are willing to fork Also, any suggestions/examples of how best to use the permissions model inside the frontend plugins? Thanks! |
c229b8d to
067a2e0
Compare
2f36aa3 to
b19c49b
Compare
|
This is ready for someone to take a look. I'm very open to feedback as this is the first time I've used react. I do have very limited time to work on this though, it's already serving our purposes as it. Thanks! |
There was a problem hiding this comment.
For similar reasons above, adding a user state to ChartContainer and ChartRenderer and including this kind of logic would not be flexible in terms of component reusability. Therefore, it would be more appropriate to handle this at the dashboard or explore component level. (Additionally, in the case of the findPermission logic, if there are many charts in the dashboard, repeating the same n+1 search logic for each chart in the user permission list would lead to inefficiency.)
In other words, this permission logic should be included in DashboardBuilder and passed as a property value to DashboardComponent, allowing access through this.props.canExportData.
Similarly, if it's included in ExploreChartPanel and passed as a property to ChartContainer, it can be accessed in the same way.
There was a problem hiding this comment.
With regards to dashboards, there is already an equivalent property supersetCanCSV passed through to dashboard/components/gridCompnents/Chart.jsx, so we can pass that to ChartContainer: canExportData={supersetCanCSV}
f49b835 to
e52fe25
Compare
|
Running CI. Ping us if it gets stuck! |
2b7048b to
b101378
Compare
…m gridConponents/chart
|
Thanks for the review @justinpark, I've made the changes you suggested. @rusackas would you mind running the CI again, it wasn't quite ready last time. I've run prettier locally so hopefully that will stop the failures. |
|
@rusackas could you re-run the CI please? Turns out the "unneeded" test change I removed in an above commit was in fact needed. I've built the js packages locally and see no test failures now. I haven't been able to run the cypress tests however as I see a |
|
Running CI 🤞 |
|
Hi there... sorry this thing seems to have fallen under our radar. We're trying to thin the backlog of unmergeable things, so we can keep a better handle on the situation and have this happen less often. I'm not sure how hard this is to rebase, but if you want to give it a go, we can try to get it merged (finally). I'll convert it to a draft in the meantime, and nowadays when you mark it ready for review, it'll get our attention again. |
|
This draft hasn't been updated in >90 days, so it will be closed. Please feel free to reopen it at any time, or ping us on this thread for further help. |
SUMMARY
Disables the user selection of data from the sqllab
resultTable,plugin-chart-pivot-tableandplugin-chart-tableif the user does not have thecan_export_csv/can_csvrole. This is based off: #28429.Relevant discussion: #29078
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION