Advanced Row Level Security (RLS) Policies // Authorization Deep Dive

  Рет қаралды 3,938

Supabase

Supabase

Күн бұрын

Row Level Security (RLS) is a way to implement Authorization in a PostgreSQL database. It automatically denies all select, insert, update and delete requests, unless a policy is written to allow them. In this video, Jon Meyers goes deep with RLS policies, showing how to enforce access rules across related tables.
Full Email Client playlist: • Build an Email Client ...
Row Level Security (RLS) in Postgres is a powerful feature that allows fine-grained control over which rows in a table can be accessed by different users. By defining policies on tables, you can restrict the visibility and modification of rows based on the attributes of the current user or other conditions. This is particularly useful in multi-tenant applications where you need to ensure that users can only see and manipulate data that belongs to them. RLS policies can be applied to `select`, `insert`, `update`, and `delete` operations, providing a flexible and secure way to enforce data access rules directly at the database level.
00:00 Introduction
01:01 Overview of users schema
02:53 Setting up a relationship across tables in different schemas
05:10 Creating a Trigger Function to insert a new user
09:26 Enabling Row Level Security (RLS)
10:28 Enabling security_invoker to enforce RLS on Views
11:55 Enforcing RLS policies for `select` from related tables
17:03 Writing a `delete` policy across related tables
20:27 Enable `insert` across related tables, using an RLS policy
22:59 Going deeper with RLS
💻 Videos to watch next:
▶ Implement Authorization using Row Level Security (RLS) with Supabase (Step By Step Guide): • Implement Authorizatio...
▶ Use AI to enable and generate RLS policies for Postgres with Supabase: • Use AI to enable and g...
▶ Learn Postgres (playlist): • Learn Postgres
👇 Learn more about Supabase 👇
🕸 Website: supabase.com/
🏁 Get started: app.supabase.com/
📄 Docs: supabase.com/docs
🔔 Subscribe for more tutorials and feature updates from Supabase: / @supabase
📱 Connect with Us:
🐙 Github: www.github.com/supabase
💬 Discord: www.discord.supabase.com/
🐦 Twitter: / supabase
▶ Instagram (follow for memes): / supabasecom
ABOUT SUPABASE:
Supabase is the open source Firebase alternative. Supabase provides a full Postgres database for every project with pgvector, backups, realtime, and more. Add and manage email and password, passwordless, OAuth, and mobile logins to your project through a suite of identity providers and APIs.
Build in a weekend, scale to millions.
#Supabase #AppDevelopment #RealtimeApps #DeveloperTools

Пікірлер: 20
@Chips4Real1
@Chips4Real1 17 күн бұрын
Please do a video on including additional data from the public schema in the session
@JonMeyers
@JonMeyers 6 күн бұрын
That’s a good one! Will add it to the list! 💯
@sergeyagronov9650
@sergeyagronov9650 17 күн бұрын
superb videos, content and delivery, hope supabase will continue to rock!!!
@JonMeyers
@JonMeyers 6 күн бұрын
It definitely will! Glad you enjoyed the video! 🙌
@caseyspaulding
@caseyspaulding 16 күн бұрын
Great! Love the content ! Thanks
@JonMeyers
@JonMeyers 6 күн бұрын
Thanks! Glad you enjoyed it! 🙌
@JonMeyers
@JonMeyers 6 күн бұрын
Thanks! Glad you enjoyed it! 🙌
@wiesson1546
@wiesson1546 17 күн бұрын
Is there a good naming pattern for the policies? I have like 70+ tables and Somehow I write "users can read" "users can select", "users can see" … I ended up to copy select / update / ... so that is it at least a bit unified
@JonMeyers
@JonMeyers 6 күн бұрын
Yeah, can get a little out of hand! I would recommend using the name to describe the policy to make it easier to parse later - “authenticated users can select their own todos” rather than “select todos policy”
@sconsalter
@sconsalter 15 күн бұрын
I created schemas to organize my tables in Supabase, but I am unable to load them in FlutterFlow. On the schema screen in FlutterFlow, only the tables in the 'public' schema appear. What configuration should I make in Supabase so that these schemas I created appear in the API?
@JonMeyers
@JonMeyers 6 күн бұрын
@dshukertjr any ideas?
@jonathangamble
@jonathangamble 17 күн бұрын
you should be using select with auth.uid()... need a video on policies and speed
@JonMeyers
@JonMeyers 6 күн бұрын
Yep, good call! This would be more efficient!
@OlivierMARTINEAU
@OlivierMARTINEAU 16 күн бұрын
Strange, I don't have the "definition" button on the view in the table editor section. Have you the same issue ?
@JonMeyers
@JonMeyers 6 күн бұрын
Oh weird! I thought this was rolled out to all projects. If you submit a support ticket to supabase.com/support someone can take a look 👍
@devstuff2576
@devstuff2576 13 күн бұрын
what is id, supabase_id, and recepient_id!
@JonMeyers
@JonMeyers 6 күн бұрын
id is the primary key of the table, supabase_id is the foreign key from another table, recipient_id is the user the email is sent to. The reason this is so convoluted is because it is adding authorization to an existing application and schema. Check out the playlist in the description if you want some more context 👍
@Hagemony
@Hagemony 17 күн бұрын
Supabase getting overcomplicated..... Let me give surrealDB a shot
@BenjaminMichotte
@BenjaminMichotte 17 күн бұрын
It’s not Supabase being complicated, it’s Postgres being powerful 😂
@JonMeyers
@JonMeyers 6 күн бұрын
@@BenjaminMichottenailed it!
Make your queries 43,240x faster
13:16
Supabase
Рет қаралды 23 М.
Каха и суп
00:39
К-Media
Рет қаралды 6 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 170 МЛН
The Right Way To Build REST APIs
10:07
Awesome
Рет қаралды 71 М.
Postgres scales … when you do this!
9:59
Supabase
Рет қаралды 3,5 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 835 М.
The Best Web Browser
10:18
Chris Titus Tech
Рет қаралды 619 М.
8 things you should NEVER do in a Database!
22:56
Supabase
Рет қаралды 10 М.
Passkeys: The Future Of Authentication
31:22
Theo - t3․gg
Рет қаралды 64 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 20 М.
Simplify complex SQL queries with Views in Postgres
26:01
Supabase
Рет қаралды 7 М.
Firebase vs Supabase - I Built The Same App With Both
6:21
Your Average Tech Bro
Рет қаралды 97 М.
Смартфон УЛУЧШАЕТ ЗРЕНИЕ!?
0:41
ÉЖИ АКСЁНОВ
Рет қаралды 1,1 МЛН
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 2,1 МЛН