Skip to content
Browse files

MDL-28615 forum: Fixed missing context regression

  • Loading branch information...
1 parent b388671 commit bdf95827b53ec1c65f3979556cd09fa050f52b32 @samhemelryk samhemelryk committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 mod/forum/lib.php
View
2 mod/forum/lib.php
@@ -5069,7 +5069,7 @@ function forum_user_can_see_post($forum, $discussion, $post, $user=NULL, $cm=NUL
$user = $USER;
}
- $canviewdiscussion = !empty($cm->cache->caps['mod/forum:viewdiscussion']) || has_capability('mod/forum:viewdiscussion', $modcontext, $user->id);
+ $canviewdiscussion = !empty($cm->cache->caps['mod/forum:viewdiscussion']) || has_capability('mod/forum:viewdiscussion', get_context_instance(CONTEXT_MODULE, $cm->id), $user->id);
if (!$canviewdiscussion && !has_all_capabilities(array('moodle/user:viewdetails', 'moodle/user:readuserposts'), get_context_instance(CONTEXT_USER, $post->userid))) {
return false;
}

0 comments on commit bdf9582

Please sign in to comment.
Something went wrong with that request. Please try again.