MDL-14908 user: Parents are not restricted when separated groups is used

This commit is contained in:
Frederic Massart
2014-12-01 15:16:03 +08:00
parent ab3effc0c6
commit c35dbd1e5b
2 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -4134,8 +4134,8 @@ class settings_navigation extends navigation_node {
return false;
}
$canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext);
if (!$canaccessallgroups && groups_get_course_groupmode($course) == SEPARATEGROUPS) {
// If groups are in use, make sure we can see that group (MDL-45874).
if (!$canaccessallgroups && groups_get_course_groupmode($course) == SEPARATEGROUPS && !$canviewuser) {
// If groups are in use, make sure we can see that group (MDL-45874). That does not apply to parents.
if ($courseid == $this->page->course->id) {
$mygroups = get_fast_modinfo($this->page->course)->groups;
} else {