This commit is contained in:
AlacrisDevs
2026-02-09 12:00:40 +02:00
parent 9885f9459d
commit 71bf7b9057
8 changed files with 126 additions and 17 deletions

View 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())
)
);