Fix policy
This commit is contained in:
parent
4941faa5ed
commit
34d700f2f4
1 changed files with 1 additions and 16 deletions
|
|
@ -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())
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue