Closed sfirke closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.90%. Comparing base (
76d897e
) to head (d8ad102
). Report is 774 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
SUMMARY
If a viewer is not logged in, or they are the public/anonymous user, and they click a link that takes them to a Superset dashboard that is not public, they are currently told "You don't have access" and sent to the list of dashboards, where they will see only public ones listed. This is often misleading: in most cases, the problem is not that they don't have access -- they just need to log in.
After the PR, such cases are routed to the login screen, and after a successful login the users are sent back to the dashboard they were trying to access.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE
https://github.com/user-attachments/assets/053bbf0e-a2f5-4e2b-8498-47694ff213a6
AFTER
https://github.com/user-attachments/assets/fc78d404-0d63-4512-9ec4-c1e813b7a66b
note I've changed the error message since recording this
TESTING INSTRUCTIONS
Create a dashboard with restricted access, try to view it while not logged in.
ADDITIONAL INFORMATION
Implements this feature request: https://github.com/apache/superset/discussions/22190 Replaces this stale PR: https://github.com/apache/superset/pull/23280
I have the DASHBOARD_RBAC flag enabled as well as the Public role in use. My code alterations are minimal so I don't think it will negatively affect deployments that differ from mine, but it would be good to have someone check.
I'm not sure how to write tests for this but am open to it if someone can advise.