mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-12081, teacher with import capability can not import course
This commit is contained in:
parent
1cd4d9dffe
commit
afbb79e1c6
3 changed files with 6 additions and 3 deletions
|
@ -55,7 +55,8 @@
|
||||||
if (empty($to)) {
|
if (empty($to)) {
|
||||||
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||||
} else {
|
} 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");
|
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
if (empty($to)) {
|
if (empty($to)) {
|
||||||
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||||
} else {
|
} 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");
|
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
if (empty($to)) {
|
if (empty($to)) {
|
||||||
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||||
} else {
|
} 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");
|
error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue