Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RLS for runs #16

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions supabase/migrations/20240812103454_rls_runs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- Enable RLS on digger_runs table
ALTER TABLE digger_runs ENABLE ROW LEVEL SECURITY;

-- Create policy for digger_runs
CREATE POLICY "Users can access digger_runs in their organizations" ON digger_runs
FOR ALL USING (
EXISTS (
SELECT 1
FROM projects p
JOIN organizations o ON p.organization_id = o.id
JOIN organization_members om ON o.id = om.organization_id
WHERE digger_runs.project_id = p.id
AND om.member_id = auth.uid()
)
);
Loading