-- RLS policies for the 'files' storage bucket
CREATE POLICY "Authenticated users can upload to files bucket"
ON storage.objects
FOR INSERT
TO authenticated
WITH CHECK (bucket_id = 'files');

CREATE POLICY "Authenticated users can read files bucket"
ON storage.objects
FOR SELECT
TO authenticated
USING (bucket_id = 'files');

CREATE POLICY "Authenticated users can update files bucket"
ON storage.objects
FOR UPDATE
TO authenticated
USING (bucket_id = 'files')
WITH CHECK (bucket_id = 'files');

CREATE POLICY "Authenticated users can delete from files bucket"
ON storage.objects
FOR DELETE
TO authenticated
USING (bucket_id = 'files');