Commit 0884ddea authored by Ankit Agarwal's avatar Ankit Agarwal
Browse files

MDL-57362 assign: Fix permission checks

parent 113d58a9
......@@ -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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment