mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
Merge branch 'MDL-45874-26' of https://github.com/danielneis/moodle into MOODLE_26_STABLE
This commit is contained in:
commit
de25146b0a
1 changed files with 10 additions and 2 deletions
|
@ -4127,8 +4127,16 @@ class settings_navigation extends navigation_node {
|
||||||
}
|
}
|
||||||
$canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext);
|
$canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext);
|
||||||
if (!$canaccessallgroups && groups_get_course_groupmode($course) == SEPARATEGROUPS) {
|
if (!$canaccessallgroups && groups_get_course_groupmode($course) == SEPARATEGROUPS) {
|
||||||
// If groups are in use, make sure we can see that group
|
// If groups are in use, make sure we can see that group (MDL-45874).
|
||||||
return false;
|
if ($courseid == $this->page->course->id) {
|
||||||
|
$mygroups = get_fast_modinfo($this->page->course)->groups;
|
||||||
|
} else {
|
||||||
|
$mygroups = groups_get_user_groups($courseid);
|
||||||
|
}
|
||||||
|
$usergroups = groups_get_user_groups($courseid, $userid);
|
||||||
|
if (!array_intersect_key($mygroups[0], $usergroups[0])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue