MDL-27855 navigation - only display participants link with permissions
authorDan Poltawski <dan.poltawski@luns.net.uk>
Sun, 3 Jul 2011 09:52:32 +0000 (10:52 +0100)
committerDan Poltawski <dan.poltawski@luns.net.uk>
Sun, 3 Jul 2011 09:52:32 +0000 (10:52 +0100)
lib/navigationlib.php

index 9691409..0168161 100644 (file)
@@ -1817,7 +1817,9 @@ class global_navigation extends navigation_node {
             } else {
                 // This is the site so add a users node to the root branch
                 $usersnode = $this->rootnodes['users'];
-                $usersnode->action = new moodle_url('/user/index.php', array('id'=>$course->id));
+                if (has_capability('moodle/course:viewparticipants', $coursecontext)) {
+                    $usersnode->action = new moodle_url('/user/index.php', array('id'=>$course->id));
+                }
                 $userviewurl = new moodle_url('/user/profile.php', $baseargs);
             }
             if (!$usersnode) {