From cde1ac3eea60141c86cdf6bec118a2f5d3f340cd Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Tue, 7 Mar 2017 12:43:30 +0530 Subject: [PATCH] MDL-57362 assign: Fix permission checks --- mod/assign/locallib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 559728825c8..d1070a02019 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -3083,7 +3083,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;