MDL-78457 course: remove participants navigation if cannot access.

This commit is contained in:
Paul Holden 2024-03-13 20:48:28 +00:00
parent 342319339f
commit 8507384ccc
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -2968,6 +2968,9 @@ class global_navigation extends navigation_node {
}
} else if (count($this->extendforuser) > 0) {
$coursenode->add(get_string('participants'), null, self::TYPE_CONTAINER, get_string('participants'), 'participants');
} else if ($siteparticipantsnode = $this->rootnodes['site']->get('participants', self::TYPE_CUSTOM)) {
// The participants node was added for the site, but cannot be viewed inside the course itself, so remove.
$siteparticipantsnode->remove();
}
// Badges.