MDL-51628 assign: invalid hardcoded capability check
authorDamyon Wiese <damyon@moodle.com>
Fri, 9 Oct 2015 06:09:33 +0000 (14:09 +0800)
committerDamyon Wiese <damyon@moodle.com>
Fri, 9 Oct 2015 06:09:33 +0000 (14:09 +0800)
Use existing function to do the check instead.

mod/assign/locallib.php

index 79d509f..32b5040 100644 (file)
@@ -5547,7 +5547,7 @@ class assign {
         require_once($CFG->dirroot . '/mod/assign/gradingoptionsform.php');
 
         // Need submit permission to submit an assignment.
-        require_capability('mod/assign:grade', $this->context);
+        $this->require_view_grades();
         require_sesskey();
 
         // Is advanced grading enabled?