-- 1. 進能服台灣落地行動方案表 (replus26_action_items) + 團隊技術評分表 (replus26_tech_evaluations)
-- 2. 強制啟用行級安全控制 (RLS):
ALTER TABLE public.replus26_action_items ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.replus26_tech_evaluations ENABLE ROW LEVEL SECURITY;
-- 3. 公開唯讀(供簡報瀏覽)+ 登入驗證寫入(零私鑰暴露)
CREATE POLICY "replus26_read_actions" ON public.replus26_action_items FOR SELECT TO anon, authenticated USING (true);
CREATE POLICY "replus26_update_actions" ON public.replus26_action_items FOR UPDATE TO authenticated USING (true) WITH CHECK (true);
CREATE POLICY "replus26_insert_actions" ON public.replus26_action_items FOR INSERT TO authenticated WITH CHECK (true);
CREATE POLICY "replus26_insert_evals" ON public.replus26_tech_evaluations FOR INSERT TO authenticated WITH CHECK (auth.uid() = user_id OR user_id IS NULL);