Skip to content

fix(rls): apply Public role RLS rules to anonymous users - #45333

Merged
EnxDev merged 4 commits into
apache:masterfrom
madhushreeag:madhu/fix-rls-public-anonymous
Oct 15, 2026
Merged

EnxDev merged 4 commits into
apache:masterfrom
madhushreeag:madhu/fix-rls-public-anonymous

Conversation

@madhushreeag

Copy link
Copy Markdown
Contributor

SUMMARY

get_current_user_subject_ids() returned [] for anonymous requests, so REGULAR RLS rules assigned to the public role (AUTH_ROLE_PUBLIC) never matched and logged-out viewers of public dashboards were not filtered. Anonymous requests now carry the public role's subject, the same role get_user_roles() grants them.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@madhushreeag
madhushreeag marked this pull request as ready for review October 15, 2026 04:52
@madhushreeag
madhushreeag requested a review from villebro October 15, 2026 04:52
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; it scopes anonymous subject lookup to roles returned by the security manager.
  • Tests cover applying the public role’s regular RLS rule to anonymous queries while keeping it out of admin queries and handling an unset public role.

Assessed commit: 3e36b3bf885a

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.45%. Comparing base (72bfc41) to head (d090562).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #45333   +/-   ##
=======================================
  Coverage   83.45%   83.45%           
=======================================
  Files        3045     3045           
  Lines      199194   199199    +5     
  Branches    46455    46457    +2     
=======================================
+ Hits       166241   166246    +5     
  Misses      29727    29727           
  Partials     3226     3226           
Flag Coverage Δ
hive 35.00% <0.00%> (-0.01%) ⬇️
mysql 52.97% <71.42%> (+<0.01%) ⬆️
postgres 52.98% <71.42%> (+<0.01%) ⬆️
presto 36.76% <28.57%> (-0.01%) ⬇️
python 86.97% <85.71%> (-0.01%) ⬇️
sqlite 52.73% <71.42%> (+<0.01%) ⬆️
unit 80.98% <57.14%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@villebro villebro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this critical fix! One optional request on the tests: if it's possible to do a full integration test without extensive mocking that would be preferable. But if not this is good to merge.

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit d090562
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ad0fb965d803df06a53ce52
😎 Deploy Preview https://deploy-preview-45333--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@madhushreeag

Copy link
Copy Markdown
Contributor Author

@villebro , added the integration test . I can merge if the changes look good to you.

@pull-request-size pull-request-size Bot added size/M and removed size/L labels Oct 15, 2026

@villebro villebro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the new test, LGTM!

@EnxDev
EnxDev merged commit 4b9856b into apache:master Oct 15, 2026
72 checks passed
villebro pushed a commit that referenced this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants