From 045ee3527982ed2de88d7a3e569bcf50a744511e Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 5 Jul 2008 13:08:07 +0000 Subject: [PATCH] MDL-14261 fixed access control issues for backup and unittest plugins; merged from MOODLE_19_STABLE --- admin/settings/top.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/admin/settings/top.php b/admin/settings/top.php index f2a8520b58..4651338ad4 100644 --- a/admin/settings/top.php +++ b/admin/settings/top.php @@ -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)); } } -- 2.39.5