MDL-50340 adminstration: Fix restore course links

This commit is contained in:
Ankit Agarwal
2015-05-25 11:11:20 +05:30
parent 803f565753
commit 2d3fcda8ec
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$ADMIN->add('courses',
new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
array('moodle/course:create')
array('moodle/restore:restorecourse')
)
);
+1 -1
View File
@@ -2401,7 +2401,7 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
* @return bool
*/
public function can_restore_courses_into() {
return has_capability('moodle/course:create', $this->get_context());
return has_capability('moodle/restore:restorecourse', $this->get_context());
}
/**
+1 -1
View File
@@ -4601,7 +4601,7 @@ class settings_navigation extends navigation_node {
}
// Restore.
if (has_capability('moodle/course:create', $catcontext)) {
if (has_capability('moodle/restore:restorecourse', $catcontext)) {
$url = new moodle_url('/backup/restorefile.php', array('contextid' => $catcontext->id));
$categorynode->add(get_string('restorecourse', 'admin'), $url, self::TYPE_SETTING, null, 'restorecourse', new pix_icon('i/restore', ''));
}