MDL-14261 fixed access control issues for backup and unittest plugins

This commit is contained in:
skodak
2008-07-05 13:05:24 +00:00
parent 5100c95157
commit 2270fd6b61
+7 -1
View File
@@ -43,7 +43,13 @@ 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;
case 'simpletest': $cap = 'moodle/site:config'; break;
default: $cap = 'moodle/site:viewreports';
}
$ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",$cap));
}
$ADMIN->add('root', new admin_category('misc', get_string('miscellaneous')));