From: toyomoyo Date: Mon, 26 Nov 2007 02:39:28 +0000 (+0000) Subject: MDL-12081, teacher with import capability can not import course X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d4c550f5d1398fa64ce482f29e94d9634b21bdbd;p=moodle.git MDL-12081, teacher with import capability can not import course --- diff --git a/backup/restore.php b/backup/restore.php index 47f20c94ef..0224a304cc 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -55,7 +55,8 @@ 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"); } } diff --git a/backup/restore_execute.html b/backup/restore_execute.html index 64be901a54..3406d7777c 100644 --- a/backup/restore_execute.html +++ b/backup/restore_execute.html @@ -26,7 +26,8 @@ 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"); } } diff --git a/backup/restore_precheck.html b/backup/restore_precheck.html index 777e24c210..2f213a4ec9 100644 --- a/backup/restore_precheck.html +++ b/backup/restore_precheck.html @@ -18,7 +18,8 @@ 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"); } }