From 2990e11355c6e8c2e1a6f39c54a911845e67189b Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 30 Nov 2007 12:08:01 +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. Merged from MOODLE_19_STABLE. --- user/view.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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! -- 2.39.5