Files
ChatApp/supabase/migrations/20260418000006_admin_profile_update.sql
T
2026-04-18 23:11:35 +02:00

12 lines
584 B
SQL

-- ============================================================================
-- Allow admins to UPDATE any profile row. Needed for the admin UI to ban,
-- block-from-inviting, or promote users. `current_user_is_admin()` already
-- exists from the initial schema.
-- ============================================================================
drop policy if exists profiles_update_admin on public.profiles;
create policy profiles_update_admin on public.profiles
for update to authenticated
using (public.current_user_is_admin())
with check (public.current_user_is_admin());