MDL-57362 assign: Fix permission checks

This commit is contained in:
Ankit Agarwal
2017-03-07 12:43:30 +05:30
parent 113d58a9f7
commit 0884ddea86
+2 -1
View File
@@ -3096,7 +3096,8 @@ class assign {
}
// Checks for the edge case when user belongs to no groups and groupmode is sep.
if ($this->get_course_module()->effectivegroupmode == SEPARATEGROUPS) {
$groupflag = !empty(groups_get_activity_allowed_groups($this->get_course_module()));
$groupflag = has_capability('moodle/site:accessallgroups', $this->get_context());
$groupflag = $groupflag || !empty(groups_get_activity_allowed_groups($this->get_course_module()));
return (bool)$groupflag;
}
return true;