Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-MDL-34530_MOODLE_23_STABLE' of git://github.com/jas…

…on-platts/moodle into MOODLE_23_STABLE
  • Loading branch information...
commit 03af084b52430fadba85b372f0343f2c5ed902cb 2 parents 4254a74 + b44d2b6
@samhemelryk samhemelryk authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 calendar/lib.php
View
12 calendar/lib.php
@@ -1721,11 +1721,19 @@ function calendar_get_allowed_types(&$allowed, $course = null) {
$allowed->courses = array($course->id => 1);
if ($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
- $allowed->groups = groups_get_all_groups($course->id);
+ if (has_capability('moodle/site:accessallgroups', $coursecontext)) {
+ $allowed->groups = groups_get_all_groups($course->id);
+ } else {
+ $allowed->groups = groups_get_all_groups($course->id, $USER->id);
+ }
}
} else if (has_capability('moodle/calendar:managegroupentries', $coursecontext)) {
if($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
- $allowed->groups = groups_get_all_groups($course->id);
+ if (has_capability('moodle/site:accessallgroups', $coursecontext)) {
+ $allowed->groups = groups_get_all_groups($course->id);
+ } else {
+ $allowed->groups = groups_get_all_groups($course->id, $USER->id);
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.