public function can_post_in_discussion(stdClass $user, discussion_entity $discussion) : bool {
        $forum = $this->get_forum();
        $forumrecord = $this->get_forum_record();
        $discussionrecord = $this->get_discussion_record($discussion);
        $context = $this->get_context();
        $coursemodule = $forum->get_course_module_record();
        $course = $forum->get_course_record();

        return forum_user_can_post($forumrecord, $discussionrecord, $user, $coursemodule, $course, $context);
    }
public function can_post_in_discussion(stdClass $user, discussion_entity $discussion) : bool {
        $forum = $this->get_forum();
        $forumrecord = $this->get_forum_record();
        $discussionrecord = $this->get_discussion_record($discussion);
        $context = $this->get_context();
        $coursemodule = $forum->get_course_module_record();
        $course = $forum->get_course_record();

        return forum_user_can_post($forumrecord, $discussionrecord, $user, $coursemodule, $course, $context);
    }
public function can_post_in_discussion ( stdClass $ user , discussion_entity $ discussion ) : bool { $ forum = $ this -> get_forum ( ) ; $ forumrecord = $ this -> get_forum_record ( ) ; $ discussionrecord = $ this -> get_discussion_record ( $ discussion ) ; $ context = $ this -> get_context ( ) ; $ coursemodule = $ forum -> get_course_module_record ( ) ; $ course = $ forum -> get_course_record ( ) ; return forum_user_can_post ( $ forumrecord , $ discussionrecord , $ user , $ coursemodule , $ course , $ context ) ; }
Can the user post in this discussion?

@param stdClass $user The user to check
@param discussion_entity $discussion The discussion to check
@return bool
Can the user post in this discussion?