pub async fn ensure_user_can_add_exercise_tasks(
conn: &mut PgConnection,
user_id: Uuid,
page_id: Option<Uuid>,
exercise_tasks: &[CmsPageExerciseTask],
) -> Result<(), ControllerError>Expand description
Rejects saving exercise_tasks on a page when that would add a task of a type only global
admins can add and the user is not one. page_id is None for a page that does not exist yet.