Skip to content

Commit

Permalink
Add rls migration for repos
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIJ committed Aug 12, 2024
1 parent acfa7ad commit e34d3e7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions supabase/migrations/20240812122822_rls_repos.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Enable Row Level Security for repos table
ALTER TABLE repos ENABLE ROW LEVEL SECURITY;

-- Create policy for repos
CREATE POLICY "Users can access repos in their organizations" ON repos
FOR ALL USING (
EXISTS (
SELECT 1
FROM organization_members om
WHERE repos.organization_id = om.organization_id
AND om.member_id = auth.uid()
)
);

0 comments on commit e34d3e7

Please sign in to comment.