]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12373 - If you can see your user profile, but don't have moodle/course:viewpartic...
authortjhunt <tjhunt>
Fri, 30 Nov 2007 12:08:01 +0000 (12:08 +0000)
committertjhunt <tjhunt>
Fri, 30 Nov 2007 12:08:01 +0000 (12:08 +0000)
user/view.php

index 2d413a515879cc2e1cfd05077e2de02cfd364277..2615236cd150f94aa481a9d999a98443dbb3fd83 100644 (file)
@@ -61,7 +61,9 @@
     $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $coursecontext));
 
     $navlinks = array();
-    $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+    if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
+        $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+    }
 
 /// If the user being shown is not ourselves, then make sure we are allowed to see them!