Skip to content

Add policy based on data in another table #724

Answered by silentworks
tawjaw asked this question in Questions
Discussion options

You must be logged in to vote

@tawjaw yes you should be able to do that, I haven't tested it but a policy like the below should work:

CREATE POLICY user_role_1_select ON todo FOR SELECT
    USING (1 = (SELECT application_role FROM users WHERE id = auth.uid));

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tawjaw
Comment options

Answer selected by tawjaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants