if (empty($to)) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
} else {
- if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))) {
+ if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))
+ && !has_capability('moodle/site:import', get_context_instance(CONTEXT_COURSE, $to))) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
if (empty($to)) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
} else {
- if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))) {
+ if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))
+ && !has_capability('moodle/site:import', get_context_instance(CONTEXT_COURSE, $to))) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}
if (empty($to)) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
} else {
- if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))) {
+ if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))
+ && !has_capability('moodle/site:import', get_context_instance(CONTEXT_COURSE, $to))) {
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
}
}