Proposal for v4: Postgres RLS feature via Marten #2111
Unanswered
mysticmind
asked this question in
Ideas
Replies: 1 comment
-
Referencing a closed issue, #1352 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working out some nuts and bolts for Postgres row level security (RLS) feature via Marten. This will allow you to enforce RLS policies such as restrict querying by tenant or other data points.
Observe the following as below steps will be required:
using
orwith check
condition which uses a session variableset_config(setting_name, setting_val, is_local)
to set a session variable and use and use the value by getting it viacurrent_setting(setting_name)
in the policy condition.In terms of Marten implementation:
1 and 2 are more to do with schema management. (3) requires a pre-hook into Marten session to ensure that the session variables get set before any other operations.
Beta Was this translation helpful? Give feedback.
All reactions