-- Allow teachers to add themselves to a school (link from directory on My Schools page)
CREATE POLICY "Teachers can insert their own TeacherSchool mapping"
ON "TeacherSchool"
FOR INSERT
TO authenticated
WITH CHECK (
  requesting_user_role() = 'teacher'
  AND "teacherId" = requesting_user_id()
);
