Войти
  • 32788Просмотров
  • 1 год назадОпубликованоSupabase

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

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: 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): ▶ Use AI to enable and generate RLS policies for Postgres with Supabase: ▶ Learn Postgres (playlist): 👇 Learn more about Supabase 👇 🕸 Website: 🏁 Get started: 📄 Docs: 🔔 Subscribe for more tutorials and feature updates from Supabase: 📱 Connect with Us: 🐙 Github: 💬 Discord: 🐦 Twitter: ▶ Instagram (follow for memes): 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