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.

This commit is contained in:
tjhunt 2007-11-30 12:08:01 +00:00
parent 6e4ca69ad7
commit 2990e11355

View 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!