You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
403 Error in Superset Embedded Mode with Gamma Guest Role #32552
When using Apache Superset in embedded mode with the Gamma role assigned to the guest user, charts fail to load data with a 403 error. The error message displayed is:
This endpoint requires the datasource *, database or all_datasource_access permission
Granting the all_datasource_access permission does not resolve the issue.
Steps to Reproduce
Pull the latest Superset code from GitHub.
Configure the application to work in embedded mode by setting:
Start the application using the following command:
docker compose up --build
Open any dashboard and enable embedding.
Use the dashboard ID in the frontend application (in this case, using @superset-ui/embedded-sdk).
Open the frontend application in the browser.
Expected Behavior
The user should be able to view all charts with data.
Actual Behavior
All charts fail to load and display the following error:
This endpoint requires the datasource *, database or all_datasource_access permission
Granting the all_datasource_access permission does not fix the issue.
Screenshots/recordings
Root Cause Analysis
This bug appeared after the <Charts/> component was refactored. The issue occurs because the request is sent to the backend without the dashboardID in the form_data object. In the previous working implementation, this was correctly set, as seen in:
Hey @mostopalove! I'm here to help you with this Superset issue. I'm a bot that can assist you with bug fixes, answer questions, and guide you on becoming a contributor. Let's tackle this together!
To resolve the 403 error in Apache Superset's embedded mode when using the Gamma role for a guest user, ensure that the dashboardID is included in the form_data object. The refactored <Charts/> component should add the dashboardID if it is present in the URL parameters. You can achieve this by using the useSelector function to access dashboardInfo and set the dashboardId in form_data as follows:
This change ensures that the dashboardID is correctly included in the form_data, which should help resolve the 403 error by allowing the backend to recognize the request context properly [1].
changed the title [-]403 Error in Superset Embedded Mode with Gamma Guest Role[/-][+]403 Error in Superset Embedded Mode with Gamma Guest Role [/+]on Mar 9, 2025
@mostopalove thanks for the report and fix! If you want to make a PR you need to first clone the Superset repo, and then push your changes to your fork; you'll then be able to create a PR.
But I'm also happy to do this for you, whatever you prefer!
Activity
dosubot commentedon Mar 9, 2025
Hey @mostopalove! I'm here to help you with this Superset issue. I'm a bot that can assist you with bug fixes, answer questions, and guide you on becoming a contributor. Let's tackle this together!
To resolve the 403 error in Apache Superset's embedded mode when using the Gamma role for a guest user, ensure that the
dashboardIDis included in theform_dataobject. The refactored<Charts/>component should add thedashboardIDif it is present in the URL parameters. You can achieve this by using theuseSelectorfunction to accessdashboardInfoand set thedashboardIdinform_dataas follows:This change ensures that the
dashboardIDis correctly included in theform_data, which should help resolve the 403 error by allowing the backend to recognize the request context properly [1].To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
[-]403 Error in Superset Embedded Mode with Gamma Guest Role[/-][+]403 Error in Superset Embedded Mode with Gamma Guest Role [/+]sadpandajoe commentedon Mar 10, 2025
I think this may be related to #32219 if not a duplicate of the same issue.
mostopalove commentedon Mar 11, 2025
@sadpandajoe Yes, it looks like the same issue. I believe my solution can also resolve #32219.
I see that you've assigned @betodealmeida to fix it—he can use my research to apply the solution.
rusackas commentedon Mar 12, 2025
I'm sure @betodealmeida would appreciate the help if you'd be willing to open a PR. They're working on a million things :)
mostopalove commentedon Mar 12, 2025
@rusackas I already have it on my computer but I don't have permission to push into github 😅
betodealmeida commentedon Mar 12, 2025
@mostopalove thanks for the report and fix! If you want to make a PR you need to first clone the Superset repo, and then push your changes to your fork; you'll then be able to create a PR.
But I'm also happy to do this for you, whatever you prefer!
Thanks!
mostopalove commentedon Mar 13, 2025
@betodealmeida I've opened a PR, and it's ready for review: #32646. Let me know if you have any feedback!