From: tjhunt Date: Fri, 30 Nov 2007 12:08:01 +0000 (+0000) Subject: MDL-12373 - If you can see your user profile, but don't have moodle/course:viewpartic... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2990e11355c6e8c2e1a6f39c54a911845e67189b;p=moodle.git MDL-12373 - If you can see your user profile, but don't have moodle/course:viewparticipants, you get a link in the nav bar that takes you to an error message. Merged from MOODLE_19_STABLE. --- diff --git a/user/view.php b/user/view.php index 2d413a5158..2615236cd1 100644 --- a/user/view.php +++ b/user/view.php @@ -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!