Fix policy

This commit is contained in:
Arthur Belleville 2025-07-09 08:01:32 +02:00
parent 4941faa5ed
commit 34d700f2f4
No known key found for this signature in database

View file

@ -73,22 +73,7 @@ CREATE POLICY "Users can update their own events in accessible tablos" ON events
AND EXISTS (
SELECT 1 FROM user_tablos ut
JOIN events ON ut.id = events.tablo_id
WHERE events.deleted_at IS NULL
AND (
ut.user_id = (SELECT auth.uid())
)
)
);
-- Policy to allow users to delete their own events in accessible tablos
CREATE POLICY "Users can delete their own events in accessible tablos" ON events
FOR DELETE USING (
created_by = (SELECT auth.uid())
AND EXISTS (
SELECT 1 FROM user_tablos ut
JOIN events ON ut.id = events.tablo_id
WHERE events.deleted_at IS NULL
AND (
WHERE (
ut.user_id = (SELECT auth.uid())
)
)