From 974fc258fbbd6cbfe9f6df4ac2ba4bbcb27a87a8 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 30 Nov 2007 12:07:25 +0000 Subject: [PATCH] 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. --- user/view.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user/view.php b/user/view.php index 2d413a51587..2615236cd15 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!