Permalink
Browse files

MDL-28615 forum: Fixed missing context regression

  • Loading branch information...
1 parent 73a4829 commit 747d6b5aacf653e1b2be512c512eb6d411579180 Sam Hemelryk committed Oct 4, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 mod/forum/lib.php
View
@@ -5070,7 +5070,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 747d6b5

Please sign in to comment.