Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-29892_overview_hidden_21' of git://github.com/andyj…

…davis/moodle into MOODLE_21_STABLE
  • Loading branch information...
commit 4278e96007f1f02e76147a2cf78ff48c8b3a19dd 2 parents 7acc253 + 045ef08
@stronk7 stronk7 authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 grade/report/overview/lib.php
View
7 grade/report/overview/lib.php
@@ -119,7 +119,14 @@ public function fill_table() {
if (!$course->showgrades) {
continue;
}
+
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+
+ if (!$course->visible && !has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
+ // The course is hidden and the user isn't allowed to see it
+ continue;
+ }
+
$courseshortname = format_string($course->shortname, true, array('context' => $coursecontext));
$courselink = html_writer::link(new moodle_url('/grade/report/user/index.php', array('id' => $course->id, 'userid' => $this->user->id)), $courseshortname);
$canviewhidden = has_capability('moodle/grade:viewhidden', $coursecontext);
Please sign in to comment.
Something went wrong with that request. Please try again.