diff --git a/supabase/migrations/20260428003554_2a6c3c06-60aa-4155-998c-a442a62a5e01.sql b/supabase/migrations/20260428003554_2a6c3c06-60aa-4155-998c-a442a62a5e01.sql new file mode 100644 index 0000000..5c368ac --- /dev/null +++ b/supabase/migrations/20260428003554_2a6c3c06-60aa-4155-998c-a442a62a5e01.sql @@ -0,0 +1,10 @@ +-- Allow updates to documents (for moving between folders) and document_folders (for renaming/moving folders) +CREATE POLICY documents_update_case ON public.documents +FOR UPDATE TO authenticated +USING (can_access_case(case_id, auth.uid())) +WITH CHECK (can_access_case(case_id, auth.uid())); + +CREATE POLICY df_update_case ON public.document_folders +FOR UPDATE TO authenticated +USING (can_access_case(case_id, auth.uid())) +WITH CHECK (can_access_case(case_id, auth.uid())); \ No newline at end of file