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


-- 启用 RLS
ALTER TABLE public.yarn_stock_records ENABLE ROW LEVEL SECURITY;

-- SELECT 策略：本公司成员可查看
CREATE POLICY users_select_yarn_stock_records ON public.yarn_stock_records
FOR SELECT USING (company_id = public.get_user_master_company_id());

-- INSERT 策略：本公司成员可插入
CREATE POLICY users_insert_yarn_stock_records ON public.yarn_stock_records
FOR INSERT WITH CHECK (company_id = public.get_user_master_company_id());

-- UPDATE 策略：本公司成员可更新自己的记录
CREATE POLICY users_update_yarn_stock_records ON public.yarn_stock_records
FOR UPDATE USING (company_id = public.get_user_master_company_id());

-- DELETE 策略：本公司成员可删除自己的记录
CREATE POLICY users_delete_yarn_stock_records ON public.yarn_stock_records
FOR DELETE USING (company_id = public.get_user_master_company_id());

