© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
30 replies
younessquick

Supabase security strategy: RLS + RPC functions only — good idea?

Hey !
I'm considering enabling RLS on all my tables without defining any policies, and then interacting with my data only through Postgres RPC functions that are marked as SECURITY DEFINER. In each function, I check at the beginning whether the requested data is accessible based on the auth.uid.

Is this a good practice, or is there a better recommended approach for handling access control in this scenario?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

enforcing security through RLS vs RPC
SupabaseSSupabase / help-and-questions
2mo ago
Allow RPC only for RLS query
SupabaseSSupabase / help-and-questions
4y ago
RLS + Security definer ?
SupabaseSSupabase / help-and-questions
4mo ago
Supabase RLS
SupabaseSSupabase / help-and-questions
3w ago