YEs
This commit is contained in:
12
supabase/migrations/057_invite_org_rls.sql
Normal file
12
supabase/migrations/057_invite_org_rls.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- Allow anyone to read organization basic info when referenced by a valid invite.
|
||||
-- This is needed so the invite page can display the org name to non-members.
|
||||
CREATE POLICY "Anyone can view org via valid invite" ON public.organizations
|
||||
FOR SELECT
|
||||
USING (
|
||||
EXISTS (
|
||||
SELECT 1 FROM public.org_invites oi
|
||||
WHERE oi.org_id = organizations.id
|
||||
AND oi.accepted_at IS NULL
|
||||
AND (oi.expires_at IS NULL OR oi.expires_at > now())
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user