-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCHECK_SUPABASE_RLS.sql
More file actions
29 lines (23 loc) · 855 Bytes
/
CHECK_SUPABASE_RLS.sql
File metadata and controls
29 lines (23 loc) · 855 Bytes
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
26
27
28
-- Run this in Supabase SQL Editor to check RLS status
-- 1. Check if RLS is enabled
SELECT tablename, rowsecurity
FROM pg_tables
WHERE schemaname = 'public' AND tablename = 'users';
-- 2. Check all policies on users table
SELECT schemaname, tablename, policyname, permissive, roles, cmd, qual, with_check
FROM pg_policies
WHERE tablename = 'users';
-- 3. Check permissions
SELECT grantee, privilege_type
FROM information_schema.role_table_grants
WHERE table_schema = 'public' AND table_name = 'users';
-- 4. Check table structure
SELECT column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'users'
ORDER BY ordinal_position;
-- 5. Check existing users
SELECT id, auth_user_id, email, name, role, approval_status, created_at
FROM public.users
ORDER BY created_at DESC
LIMIT 5;