1
Enable using RLS without the usage of built-in Supabase Auth
Source: supabase/supabase#2074 · opened by @jcheese1
Hey,
So I currently use Prisma with Supabase, and I do all the authorization via just a simple Session table that keeps track of logged in users. It would be great if I can implement RLS with a custom auth solution, like in my case.
I'm thinking of something like this:
• Getting the user via session ID
• Check if the bucket they are trying to access is their own
• Depending on that allow read/write
on the side of Supabase.
I guess I can just have some sort of a middleware to check the above, but I think its safer to have it on the DB side.
I hope this makes sense!
So I currently use Prisma with Supabase, and I do all the authorization via just a simple Session table that keeps track of logged in users. It would be great if I can implement RLS with a custom auth solution, like in my case.
I'm thinking of something like this:
• Getting the user via session ID
• Check if the bucket they are trying to access is their own
• Depending on that allow read/write
on the side of Supabase.
I guess I can just have some sort of a middleware to check the above, but I think its safer to have it on the DB side.
I hope this makes sense!
No pledges yet. Be the first to back this.
Comments
Similar requests
Better protection against failing to protect tables with RLS
1 vote · 0 comments
Add Feature to Test + Debug Row Level Security Policies
47 votes · 0 comments
Default RLS Policies.
3 votes · 0 comments
Move RLS verification into the policy editor, not beside it
1 vote · 0 comments
RLS Should Log Rejections
6 votes · 0 comments
No comments yet.