Add mdx support for Events content

This commit is contained in:
ArtemBozhko
2026-10-09 12:51:43 +03:00
parent e2d097f918
commit 52326657d3
10 changed files with 5065 additions and 68 deletions
@@ -0,0 +1,48 @@
-- Create storage bucket for rich text content images
insert into storage.buckets (id, name, public)
values ('event-content-images', 'event-content-images', true)
on conflict (id) do nothing;
-- Allow public read access to content images
create policy "content_images_select_public" on storage.objects
for select
using (bucket_id = 'event-content-images');
-- Allow authenticated admins to upload content images
create policy "content_images_insert_admin" on storage.objects
for insert
with check (
bucket_id = 'event-content-images'
and auth.role() = 'authenticated'
and exists (
select 1 from public.profiles p
where p.id = auth.uid()
and p.is_admin
)
);
-- Allow authenticated admins to update content images
create policy "content_images_update_admin" on storage.objects
for update
using (
bucket_id = 'event-content-images'
and auth.role() = 'authenticated'
and exists (
select 1 from public.profiles p
where p.id = auth.uid()
and p.is_admin
)
);
-- Allow authenticated admins to delete content images
create policy "content_images_delete_admin" on storage.objects
for delete
using (
bucket_id = 'event-content-images'
and auth.role() = 'authenticated'
and exists (
select 1 from public.profiles p
where p.id = auth.uid()
and p.is_admin
)
);