protected function can_post($course, $forum, $discussion, $post, $cm, $context) {
        if (!isset($this->canpostto[$discussion->id])) {
            $this->canpostto[$discussion->id] = forum_user_can_post($forum, $discussion, $this->recipient, $cm, $course, $context);
        }
        return $this->canpostto[$discussion->id];
    }
protected function can_post($course, $forum, $discussion, $post, $cm, $context) {
        if (!isset($this->canpostto[$discussion->id])) {
            $this->canpostto[$discussion->id] = forum_user_can_post($forum, $discussion, $this->recipient, $cm, $course, $context);
        }
        return $this->canpostto[$discussion->id];
    }
protected function can_post ( $ course , $ forum , $ discussion , $ post , $ cm , $ context ) { if ( ! isset ( $ this -> canpostto [ $ discussion -> id ] ) ) { $ this -> canpostto [ $ discussion -> id ] = forum_user_can_post ( $ forum , $ discussion , $ this -> recipient , $ cm , $ course , $ context ) ; } return $ this -> canpostto [ $ discussion -> id ] ; }
Check whether the user can post.

@param   \stdClass   $course
@param   \stdClass   $forum
@param   \stdClass   $discussion
@param   \stdClass   $post
@param   \stdClass   $cm
@param   \context    $context
@return  bool
Check whether the user can post .