Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-59195 assignsubmission_comments: fix permission checks
  • Loading branch information
davosmith committed Aug 21, 2017
1 parent fca5d3d commit 31fb719
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions mod/assign/submission/comments/lib.php
Expand Up @@ -48,15 +48,6 @@ function assignsubmission_comments_comment_validate(stdClass $options) {
if ($assignment->get_instance()->id != $submission->assignment) {
throw new comment_exception('invalidcontext');
}
$canview = false;
if ($submission->userid) {
$canview = $assignment->can_view_submission($submission->userid);
} else {
$canview = $assignment->can_view_group_submission($submission->groupid);
}
if (!$canview) {
throw new comment_exception('nopermissiontocomment');
}

return true;
}
Expand Down
1 change: 0 additions & 1 deletion mod/assign/submission/comments/locallib.php
Expand Up @@ -69,7 +69,6 @@ public function view_summary(stdClass $submission, & $showviewlink) {
$options->displaycancel = true;

$comment = new comment($options);
$comment->set_view_permission(true);

$o = $this->assignment->get_renderer()->container($comment->output(true), 'commentscontainer');
return $o;
Expand Down

0 comments on commit 31fb719

Please sign in to comment.