MDL-14261 fixed access control issues for backup and unittest plugins; merged from MOODLE_19_STABLE

This commit is contained in:
skodak
2008-07-05 13:08:07 +00:00
parent 961ca45fc0
commit 045ee35279
+6 -1
View File
@@ -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));
}
}