현재 작업 상태 저장

This commit is contained in:
Yun Chan 2026-06-27 11:20:24 +09:00
parent 07cc67761e
commit 6bd91b0d5e
674 changed files with 8726 additions and 298 deletions

View file

@ -212,6 +212,68 @@ CREATE POLICY p_feedback_select ON app.feedback_scores FOR SELECT USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_feedback_insert ON app.feedback_scores;
CREATE POLICY p_feedback_insert ON app.feedback_scores FOR INSERT WITH CHECK (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_feedback_update ON app.feedback_scores;
CREATE POLICY p_feedback_update ON app.feedback_scores FOR UPDATE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
) WITH CHECK (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
-- ── normalized turn evaluation tables: 원시 평가는 evaluator/admin만 직접 접근 ──
ALTER TABLE app.turn_technique ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS p_turn_technique_select ON app.turn_technique;
CREATE POLICY p_turn_technique_select ON app.turn_technique FOR SELECT USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_turn_technique_insert ON app.turn_technique;
CREATE POLICY p_turn_technique_insert ON app.turn_technique FOR INSERT WITH CHECK (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
ALTER TABLE app.turn_client_state ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS p_turn_client_state_select ON app.turn_client_state;
CREATE POLICY p_turn_client_state_select ON app.turn_client_state FOR SELECT USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_turn_client_state_insert ON app.turn_client_state;
CREATE POLICY p_turn_client_state_insert ON app.turn_client_state FOR INSERT WITH CHECK (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
ALTER TABLE app.supervisor_comment ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS p_supervisor_comment_select ON app.supervisor_comment;
CREATE POLICY p_supervisor_comment_select ON app.supervisor_comment FOR SELECT USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_supervisor_comment_insert ON app.supervisor_comment;
CREATE POLICY p_supervisor_comment_insert ON app.supervisor_comment FOR INSERT WITH CHECK (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
ALTER TABLE app.alternative_utterance ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS p_alternative_utterance_select ON app.alternative_utterance;
CREATE POLICY p_alternative_utterance_select ON app.alternative_utterance FOR SELECT USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_alternative_utterance_insert ON app.alternative_utterance;
CREATE POLICY p_alternative_utterance_insert ON app.alternative_utterance FOR INSERT WITH CHECK (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
-- ── case_profile / pinned_fact: 학습자=본인 케이스만(cross-trainee 누수 차단 T4) ──
ALTER TABLE app.case_profile ENABLE ROW LEVEL SECURITY;