mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 07:11:13 -05:00
Refactor admin blog access
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- Drop existing policy that allows moderators
|
||||
DROP POLICY IF EXISTS "Admins can do everything" ON public.blog_posts;
|
||||
|
||||
-- Create new policy for admins and superusers only
|
||||
CREATE POLICY "Admins and superusers can manage blog posts"
|
||||
ON public.blog_posts FOR ALL
|
||||
USING (
|
||||
has_role(auth.uid(), 'admin'::app_role) OR
|
||||
has_role(auth.uid(), 'superuser'::app_role)
|
||||
);
|
||||
Reference in New Issue
Block a user