- Added public discovery section for active splits on the landing page - Refactored split detail page for guest support and login redirects - Extracted SplitCard component for reuse - Consolidated RLS policies for bottles and tastings to resolve permission errors - Added unified SQL consolidation script for RLS and naming fixes - Enhanced service logging for better database error diagnostics
10 lines
362 B
SQL
10 lines
362 B
SQL
-- Allow participants to see the split record even if it's not active anymore
|
|
DROP POLICY IF EXISTS "bottle_splits_participant_view" ON bottle_splits;
|
|
CREATE POLICY "bottle_splits_participant_view" ON bottle_splits
|
|
FOR SELECT USING (
|
|
EXISTS (
|
|
SELECT 1 FROM split_participants
|
|
WHERE split_id = bottle_splits.id AND user_id = (SELECT auth.uid())
|
|
)
|
|
);
|