MDL-74205 navigation: Don't show participants link to user if he has no permission.

This commit is contained in:
Ilya Tregubov
2022-03-30 10:42:11 +06:00
parent efda17d3b0
commit 053785ff5f
2 changed files with 31 additions and 2 deletions
+2 -2
View File
@@ -2939,8 +2939,8 @@ class global_navigation extends navigation_node {
if ($navoptions->notes) {
$participants->add(get_string('notes', 'notes'), new moodle_url('/notes/index.php', array('filtertype' => 'course', 'filterselect' => $course->id)), self::TYPE_SETTING, null, 'currentcoursenotes');
}
} else if (count($this->extendforuser) > 0 || $this->page->course->id == $course->id) {
$participants = $coursenode->add(get_string('participants'), null, self::TYPE_CONTAINER, get_string('participants'), 'participants');
} else if (count($this->extendforuser) > 0) {
$coursenode->add(get_string('participants'), null, self::TYPE_CONTAINER, get_string('participants'), 'participants');
}
// Badges.