EnxDev opened a new pull request, #38474:
URL: https://github.com/apache/superset/pull/38474

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   When loading an embedded dashboard, the frontend calls `/api/v1/me/roles/` 
as its very first action to bootstrap user permissions. 
   This call hits the `CurrentUserRestApi` endpoint, which requires 
`("can_read", "CurrentUserRestApi")` in the user's role.
   
   This permission was missing from PUBLIC_ROLE_PERMISSIONS, the set of 
defaults applied to the Public role when `PUBLIC_ROLE_LIKE = "Public" is 
configured`.
    
   As a result, guest/embedded users received a `403` on the bootstrap call, 
and the embedded dashboard displayed a black screen with "Something went wrong 
with embedded authentication" instead of rendering.
   
   This also affects deployments that manually configure their embedded role 
based on the documented defaults,  the permission was simply never listed.
   
   The fix adds `("can_read", "CurrentUserRestApi")` alongside the existing 
embedded permissions (EmbeddedDashboard, Theme, etc.) in 
PUBLIC_ROLE_PERMISSIONS. 
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   - Before
   
   <img width="1339" height="1259" alt="Screenshot 2026-03-05 114951" 
src="https://github.com/user-attachments/assets/9d349a30-8b4a-428f-a680-1165b2dbc1bd";
 />
   
   - Afer
   
   <img width="1856" height="1260" alt="Screenshot 2026-03-05 115227" 
src="https://github.com/user-attachments/assets/d0890a10-f36d-470c-9022-44ac044b9d18";
 />
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   Add to superset_config.py:
   `PUBLIC_ROLE_LIKE = "Public"`
   `FEATURE_FLAGS = {"EMBEDDED_SUPERSET": True}`
   
   2. Run `superset init` to sync permissions
   3. Verify the Public role now includes can_read on CurrentUserRestApi:
   Settings → Security → List Roles → Public
   4. Create a dashboard and enable embedding (ellipsis menu → Embed dashboard)
   5. Use the [Superset Embedded 
SDK](https://www.npmjs.com/package/@superset-ui/embedded-sdk) to load the 
dashboard with a guest token
   6. Expected: Dashboard renders successfully
   7. Before this fix: Black screen with "Something went wrong with embedded 
authentication"
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to