WebVNWrite/supabase/migrations/20260124100000_allow_profil...

11 lines
478 B
SQL

-- Migration: Allow authenticated users to look up profiles for sharing
-- Problem: The profiles RLS policies only allow users to see their own profile
-- (or admins to see all). This prevents the sharing feature from finding
-- users by email since the query is blocked by RLS.
-- Solution: Add a SELECT policy allowing any authenticated user to view profiles.
CREATE POLICY "Authenticated users can view profiles"
ON profiles
FOR SELECT
USING (auth.uid() IS NOT NULL);