mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 02:11:12 -05:00
Fix: Remove .select() from delete operations
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
-- Allow moderators to delete test data from version tables
|
||||
-- This enables test data cleanup operations to work properly
|
||||
|
||||
-- Park versions
|
||||
CREATE POLICY "Moderators can delete test park versions"
|
||||
ON park_versions
|
||||
FOR DELETE
|
||||
TO authenticated
|
||||
USING (
|
||||
is_test_data = true
|
||||
AND is_moderator(auth.uid())
|
||||
);
|
||||
|
||||
-- Ride versions
|
||||
CREATE POLICY "Moderators can delete test ride versions"
|
||||
ON ride_versions
|
||||
FOR DELETE
|
||||
TO authenticated
|
||||
USING (
|
||||
is_test_data = true
|
||||
AND is_moderator(auth.uid())
|
||||
);
|
||||
|
||||
-- Company versions
|
||||
CREATE POLICY "Moderators can delete test company versions"
|
||||
ON company_versions
|
||||
FOR DELETE
|
||||
TO authenticated
|
||||
USING (
|
||||
is_test_data = true
|
||||
AND is_moderator(auth.uid())
|
||||
);
|
||||
|
||||
-- Ride model versions
|
||||
CREATE POLICY "Moderators can delete test ride model versions"
|
||||
ON ride_model_versions
|
||||
FOR DELETE
|
||||
TO authenticated
|
||||
USING (
|
||||
is_test_data = true
|
||||
AND is_moderator(auth.uid())
|
||||
);
|
||||
Reference in New Issue
Block a user