-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_rls_fix.sql
More file actions
25 lines (20 loc) · 1.23 KB
/
admin_rls_fix.sql
File metadata and controls
25 lines (20 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- =====================================================
-- Admin RLS Policies for Brands & Products
-- Run this in Supabase SQL Editor to allow editing
-- =====================================================
-- Allow all operations on brands (for admin)
DROP POLICY IF EXISTS "Allow public read access on brands" ON brands;
DROP POLICY IF EXISTS "Allow all access on brands" ON brands;
DROP POLICY IF EXISTS "Allow insert on brands" ON brands;
DROP POLICY IF EXISTS "Allow update on brands" ON brands;
DROP POLICY IF EXISTS "Allow delete on brands" ON brands;
CREATE POLICY "Allow all access on brands" ON brands FOR ALL USING (true) WITH CHECK (true);
-- Allow all operations on products (for admin)
DROP POLICY IF EXISTS "Allow public read access on products" ON products;
DROP POLICY IF EXISTS "Allow all access on products" ON products;
DROP POLICY IF EXISTS "Allow insert on products" ON products;
DROP POLICY IF EXISTS "Allow update on products" ON products;
DROP POLICY IF EXISTS "Allow delete on products" ON products;
CREATE POLICY "Allow all access on products" ON products FOR ALL USING (true) WITH CHECK (true);
-- Verify
SELECT tablename, policyname FROM pg_policies WHERE schemaname = 'public' AND tablename IN ('brands', 'products');