public function can_add_instance($courseid) {
        global $CFG, $DB;
        require_once($CFG->dirroot.'/mnet/service/enrol/locallib.php');

        $service = mnetservice_enrol::get_instance();
        if (!$service->is_available()) {
            return false;
        }
        $coursecontext = context_course::instance($courseid);
        if (!has_capability('moodle/course:enrolconfig', $coursecontext)) {
            return false;
        }
        $subscribers = $service->get_remote_subscribers();
        if (empty($subscribers)) {
            return false;
        }

        return true;
    }