MDL-40353 fixed wrong redirection on course group page
authorMarina Glancy <marina@moodle.com>
Thu, 27 Jun 2013 03:45:16 +0000 (13:45 +1000)
committerMarina Glancy <marina@moodle.com>
Thu, 27 Jun 2013 03:56:16 +0000 (13:56 +1000)
group/index.php

index f237605..9a0df5f 100644 (file)
@@ -56,12 +56,10 @@ $PAGE->set_url($url);
 // Make sure that the user has permissions to manage groups.
 require_login($course);
 
-$PAGE->requires->js('/group/clientlib.js');
-
 $context = context_course::instance($course->id);
-if (!has_capability('moodle/course:managegroups', $context)) {
-    redirect('/course/view.php', array('id'=>$course->id)); // Not allowed to manage all groups
-}
+require_capability('moodle/course:managegroups', $context);
+
+$PAGE->requires->js('/group/clientlib.js');
 
 // Check for multiple/no group errors
 if (!$singlegroup) {