]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13245 Merged viewallfix from stable 1.9
authormoodler <moodler>
Thu, 31 Jan 2008 01:30:43 +0000 (01:30 +0000)
committermoodler <moodler>
Thu, 31 Jan 2008 01:30:43 +0000 (01:30 +0000)
blocks/admin/block_admin.php

index 7c189d0a55fc9fb2bf5cf0cffed1aa39d0b4f6b3..92491a43cbd35018d811d988ce12e577503433e9 100644 (file)
@@ -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;
                         }