From: moodler Date: Thu, 31 Jan 2008 01:30:43 +0000 (+0000) Subject: MDL-13245 Merged viewallfix from stable 1.9 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1ee0c98322f72ee0b7f080178c25507c6a6f6dc6;p=moodle.git MDL-13245 Merged viewallfix from stable 1.9 --- diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php index 7c189d0a55..92491a43cb 100644 --- a/blocks/admin/block_admin.php +++ b/blocks/admin/block_admin.php @@ -73,12 +73,14 @@ class block_admin extends block_list { /// find all accessible reports if ($course->id !== SITEID) { $reportavailable = false; - if (!empty($course->showgrades)) { + if (has_capability('moodle/grade:viewall', $context)) { + $reportavailable = true; + } else if (!empty($course->showgrades)) { if ($reports = get_list_of_plugins('grade/report')) { // Get all installed reports arsort($reports); // user is last, we want to test it first foreach ($reports as $plugin) { if (has_capability('gradereport/'.$plugin.':view', $context)) { - //stop when fisrt visible found + //stop when the first visible plugin is found $reportavailable = true; break; }