mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 04:51:13 -05:00
42 lines
890 B
SQL
42 lines
890 B
SQL
-- 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())
|
|
); |