superset: Cannot use drill-by/drill-to in embedded mode without `can explore on Superset` permission
When a dashboard is accessed using the embedding UI, the Drill By/Drill to Detail functions in the right click menu and chart menu are only available if the guest user Role has the can explore on Superset permission. However, this permission also enables heading links to the Explore screen, along with other chart menu options which are not desirable in an embedded chart, e.g.:
- View Query
- Edit Chart
If the user does have the can explore on Superset but lacks the can samples on Datasource permission, the Drill to detail [by] menu items appear but the data cannot be loaded.
How to reproduce the bug
- Set up an embedded dashboard, with a chart such as a Pie Chart that has drill functionality.
- Give the guest user Role
can explore on Supersetpermission. - Load the embedded dashboard.
- Right click on the chart.
Expected results
Given some other permission applied to the guest user (I’m unsure which one is appropriate, or if a new one is needed), and given they don’t have can explore on Superset:
- You can use the drill functions in the right click and chart menu. If the user does not have
can samples on Datasourcepermission,Drill to detailandDrill to detail bywill not appear in the menu. - You cannot click on the header of the chart (it’s not a link).
- Edit Chart and View Query will not appear in the menu.
Actual results
- You can use the drill functions in the menu. If the user does not have
can samples on Datasourcepermission, openingDrill to detailorDrill to detail bywill display an errorError: Access is Denied. - You can click on the header of the chart, which will take you to a blank page
- You can open the chart menu and Edit Chart, which will take you to a blank page
- You can open the chart menu and View Query successfully
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
(please complete the following information):
- browser type and version: Google Chrome Version 117.0.5938.149 (Official Build) (x86_64)
- superset version: 3.0.0
- python version: 3.9.1
- node.js version: v16.9.1
- any feature flags active:
- ALERT_REPORTS
- EMBEDDED_SUPERSET
- HORIZONTAL_FILTER_BAR
- DASHBOARD_CROSS_FILTERS
- DRILL_TO_DETAIL
- DRILL_BY
- ENABLE_TEMPLATE_PROCESSING
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven’t found one similar.
Additional context
The files in which the permissions are checked and need updating are:
- ChartContextMenu.tsx
- SliceHeaderControls/index.tsx
- SliceHeader/index.tsx
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (8 by maintainers)
Getting the correct permissions for using embedded is indeed very difficult and hard to maintain. As of now, not even the Gamma role contains all the needed permissions.
The best solution would probably be to have a new standard “Embedded” role that one can use a base.
I may have mentioned the incorrect permission in that old Slack thread. Link
What is actually needed is:
can read on Explorecan samples on Datasourcecan explore json on Superset(I’m not 100% sure if that one is actually needed for drill by)can explore on Supersetis not needed at all and it does have the unintended side-effects you describe.As best as I can work out, this is the bare minimum list for an embedded dashboard with Drill By (currently) which I’ve applied to my Guest user:
*I think this needs a fix, should work with specified datasets, though I’m not sure if guest tokens restrict the datasets or leave it open to all **to address under this bug, should work with
can read on Explore@cwegener you’re right,
can explore Json on Supersetdoesn’t seem to be needed.