MDL-63571 grade_report_grader: Use correct context for capability check
authorJun Pataleta <jun@moodle.com>
Thu, 22 Nov 2018 08:18:27 +0000 (16:18 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 22 Nov 2018 08:19:38 +0000 (16:19 +0800)
grade/report/grader/lib.php

index cb3f837..1b82a20 100644 (file)
@@ -1911,7 +1911,7 @@ class grade_report_grader extends grade_report {
 
         // Sourced from tablelib.php
         // Check the full name display for sortable fields.
-        if (has_capability('moodle/site:viewfullnames', context_system::instance())) {
+        if (has_capability('moodle/site:viewfullnames', $this->context)) {
             $nameformat = $CFG->alternativefullnameformat;
         } else {
             $nameformat = $CFG->fullnamedisplay;