Skip to content
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

[4.x] Make forcing RLS configurable #1293

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

lukinovec
Copy link
Contributor

This PR adds the $forceRls static property to the tenants:rls command.

If $forceRls is true (default), the table owners won't be able to query their own tables (unless the owners have the BYPASSRLS privilege). If the property is set to false, table owners will bypass RLS, allowing them to query the owned tables.

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.04%. Comparing base (0e223e0) to head (3fabdf8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1293      +/-   ##
============================================
+ Coverage     84.68%   85.04%   +0.35%     
- Complexity     1036     1067      +31     
============================================
  Files           175      176       +1     
  Lines          3043     3163     +120     
============================================
+ Hits           2577     2690     +113     
- Misses          466      473       +7     

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

@TheDeadCode
Copy link

Any news on this? <3

Comment on lines +578 to +579
// The table owner should see all the records
expect(Order::all())->toHaveCount(2);
Copy link
Member

Choose a reason for hiding this comment

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

In this test, add a dataset for $forceRls so the difference is actually observed. Assuming createPostgresUser() creates a user without BYPASSRLS, the change should be simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants