Skip to content

Commit

Permalink
Merge branch 'wip-MDL-38300-m25' of git://github.com/samhemelryk/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Mar 5, 2013
2 parents caa5bce + cf73861 commit 2b48123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3976,14 +3976,14 @@ protected function generate_user_settings($courseid, $userid, $gstitle='usercurr
$reportfunction($reporttab, $user, $course);
}
$anyreport = has_capability('moodle/user:viewuseractivitiesreport', $usercontext);
if ($anyreport || ($course->showreports && $iscurrentuser && $forceforcontext)) {
if ($anyreport || ($course->showreports && $currentuser && $forceforcontext)) {
// Add grade hardcoded grade report if necessary.
$gradeaccess = false;
if (has_capability('moodle/grade:viewall', $coursecontext)) {
// Can view all course grades.
$gradeaccess = true;
} else if ($course->showgrades) {
if ($iscurrentuser && has_capability('moodle/grade:view', $coursecontext)) {
if ($currentuser && has_capability('moodle/grade:view', $coursecontext)) {
// Can view own grades.
$gradeaccess = true;
} else if (has_capability('moodle/grade:viewall', $usercontext)) {
Expand Down

0 comments on commit 2b48123

Please sign in to comment.