From 7e910ce23d5a02fc8d91e49cbcee2025d43cc710 Mon Sep 17 00:00:00 2001 From: denshooter Date: Fri, 24 Apr 2026 12:38:54 +0000 Subject: [PATCH] Allow anonymous posts in public feed - update posts_select RLS to allow approved/ok posts regardless of anonymity - sync baseline and perf-fix migrations with live policy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- infrastructure/migrations/001_schema.sql | 4 ---- infrastructure/migrations/002_perf_linter_fixes.sql | 4 ---- 2 files changed, 8 deletions(-) diff --git a/infrastructure/migrations/001_schema.sql b/infrastructure/migrations/001_schema.sql index 84867e1..a8a7d8c 100644 --- a/infrastructure/migrations/001_schema.sql +++ b/infrastructure/migrations/001_schema.sql @@ -207,10 +207,6 @@ CREATE POLICY "posts_select" ON public.posts FOR SELECT USING ( deleted_at IS NULL AND review_status IN ('ok', 'approved') - AND ( - NOT is_anonymous - OR user_id = (select auth.uid()) - ) ); CREATE POLICY "posts_insert" ON public.posts FOR INSERT WITH CHECK ((select auth.uid()) = user_id); diff --git a/infrastructure/migrations/002_perf_linter_fixes.sql b/infrastructure/migrations/002_perf_linter_fixes.sql index 5ecaf20..0d3e76e 100644 --- a/infrastructure/migrations/002_perf_linter_fixes.sql +++ b/infrastructure/migrations/002_perf_linter_fixes.sql @@ -12,10 +12,6 @@ ALTER POLICY posts_select ON public.posts USING ( deleted_at IS NULL AND review_status IN ('ok', 'approved') - AND ( - NOT is_anonymous - OR user_id = (select auth.uid()) - ) ); ALTER POLICY posts_insert ON public.posts