-- ============================================
-- 此文件由 Meoo Cloud 自动生成，请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================


CREATE POLICY users_update_plan_factories ON plan_factories
 FOR UPDATE
 USING (factory_id = get_user_master_company_id() OR EXISTS (SELECT 1 FROM production_plans WHERE production_plans.id = plan_factories.plan_id AND production_plans.purchaser_id = get_user_master_company_id()));

