-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: embedded dashboard check #24690
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24690 +/- ##
==========================================
+ Coverage 68.97% 69.02% +0.04%
==========================================
Files 1907 1902 -5
Lines 74153 73940 -213
Branches 8182 8160 -22
==========================================
- Hits 51148 51037 -111
+ Misses 20882 20785 -97
+ Partials 2123 2118 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 9 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
return | ||
elif ( | ||
# To understand why we rely on status and give access to draft dashboards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the references. I agree that this logic is hard to understand and only exists for backward compatibility. I added a card to our major versions board to revisit this in 4.0 and break compatibility in favor of a clear and more restrictive logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second @michael-s-molina's comment. I think the security logic for dashboard access is rather convoluted and difficult to grok which is definitely undesirable from a security perspective, i.e., there likely are holes which can be exploited.
I wonder if in 4.0 if dashboard RBAC should no longer be a feature but rather the default which will likely simplify things even if (per @michael-s-molina's comment) this breaks compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if in 4.0 if dashboard RBAC should no longer be a feature but rather the default which will likely simplify things even if (per @michael-s-molina's comment) this breaks compatibility.
Interesting. I'll add this comment to the card to help the discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 9844b15)
SUMMARY
When a guest user with an embedded dashboard token tries to access a non-embedded dashboard we allow as long as the other dashboard is in draft or the other dashboard has no datasources or at least one datasource that the user has access.
This PR fixes the logic, so that guest users have access only if they have the proper token. I also left some comments to the discussion about the
raise_for_dashboard_access
, because the logic is very convoluted, non-intuitive, and remains so for backwards compatibility reasons.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION