Commit 2d3fcda8 authored by Ankit Agarwal's avatar Ankit Agarwal
Browse files

MDL-50340 adminstration: Fix restore course links

parent 803f5657
......@@ -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')
)
);
......
......@@ -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());
}
/**
......
......@@ -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', ''));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment