MDL-14261 fixed access control issues for backup and unittest plugins; merged from MOODLE_19_STABLE
This commit is contained in:
@@ -42,7 +42,12 @@ foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
|
||||
if ($reportname[1] == '[') {
|
||||
$reportname = get_string($plugin, 'admin');
|
||||
}
|
||||
$ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",'moodle/site:viewreports'));
|
||||
// ugly hack for special access control in reports
|
||||
switch($plugin) {
|
||||
case 'backups': $cap = 'moodle/site:backup'; break;
|
||||
default: $cap = 'moodle/site:viewreports';
|
||||
}
|
||||
$ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",$cap));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user