Skip to content

Commit

Permalink
Merge branch 'MDL-49351-27' of git://github.com/jleyva/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_27_STABLE
  • Loading branch information
David Monllao committed Mar 10, 2015
2 parents 723e307 + 5f6ae21 commit 69067fb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rating/index.php
Expand Up @@ -58,9 +58,8 @@
if (!has_capability('moodle/rating:view',$context)) {
print_error('noviewrate', 'rating');
}
if (!has_capability('moodle/rating:viewall',$context) and $USER->id != $item->userid) {
print_error('noviewanyrate', 'rating');
}

$canviewallratings = has_capability('moodle/rating:viewall', $context);

switch ($sort) {
case 'firstname': $sqlsort = "u.firstname ASC"; break;
Expand Down Expand Up @@ -112,6 +111,10 @@
$maxrating = max(array_keys($scalemenu));

foreach ($ratings as $rating) {
if (!$canviewallratings and $USER->id != $rating->userid) {
continue;
}

//Undo the aliasing of the user id column from user_picture::fields()
//we could clone the rating object or preserve the rating id if we needed it again
//but we don't
Expand Down

0 comments on commit 69067fb

Please sign in to comment.