Skip to content

Commit 91bbb1c

Browse files
Yushin-Lclaude
andcommitted
Add RLS policy to allow anyone to read published posts
Previously only authors and admins could read post_drafts rows, so published posts were invisible to other users. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cfede3d commit 91bbb1c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- ============================================================
2+
-- Allow anyone to read published posts
3+
-- ============================================================
4+
5+
CREATE POLICY "Anyone can read published posts"
6+
ON public.post_drafts FOR SELECT
7+
USING (status = 'published');

0 commit comments

Comments
 (0)