public static function action_course_hide(\core_course_list_element $course) {
        if (!$course->can_change_visibility()) {
            throw new \moodle_exception('permissiondenied', 'error', '', null,
                'core_course_list_element::can_change_visbility');
        }
        return course_change_visibility($course->id, false);
    }