rusackas opened a new pull request, #42250:
URL: https://github.com/apache/superset/pull/42250
### SUMMARY
Issue #42239 reports an Admin getting `Sorry, there was an error saving this
dashboard: Forbidden` when resizing a chart and saving. Assessing whether that
can be a Superset permission bug:
- The backend already proves an Admin `PUT /api/v1/dashboard/{id}` with
`position_json` succeeds (`test_update_dashboard` in
`tests/integration_tests/dashboards/api_tests.py`).
- A 403 produced by Superset's own permission layer has the JSON body
`{"message": "Forbidden"}`, which `getErrorText` maps to the distinct toast
`You do not have permission to edit this dashboard` (already covered).
- The toast in the report (`...: Forbidden`) is only reachable when the 403
body is **not** that JSON shape, i.e. an HTML/plain-text response from
something in front of Superset (reverse proxy, WAF, SSO gateway), where
`getClientErrorObject` falls back to the status-code lookup.
That third mapping was untested. This adds a green test pinning both 403
shapes to their respective toasts, so the generic `: Forbidden` toast remains a
reliable signal that the rejection originated outside Superset. If either
mapping ever regresses, this catches the diagnostic drifting.
No production code changes.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A, test only.
### TESTING INSTRUCTIONS
```
cd superset-frontend
npm run test --
packages/superset-ui-core/test/query/getClientErrorObject.test.ts
```
### ADDITIONAL INFORMATION
- [x] Has associated issue: Refs #42239
- [ ] 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]