protected function check_read_permission( $comment ) {
		if ( ! empty( $comment->comment_post_ID ) ) {
			$post = get_post( $comment->comment_post_ID );
			if ( $post ) {
				if ( $this->check_read_post_permission( $post ) && 1 === (int) $comment->comment_approved ) {
					return true;
				}
			}
		}

		if ( 0 === get_current_user_id() ) {
			return false;
		}

		if ( empty( $comment->comment_post_ID ) && ! current_user_can( 'moderate_comments' ) ) {
			return false;
		}

		if ( ! empty( $comment->user_id ) && get_current_user_id() === (int) $comment->user_id ) {
			return true;
		}

		return current_user_can( 'edit_comment', $comment->comment_ID );
	}
protected function check_read_permission( $comment ) {
		if ( ! empty( $comment->comment_post_ID ) ) {
			$post = get_post( $comment->comment_post_ID );
			if ( $post ) {
				if ( $this->check_read_post_permission( $post ) && 1 === (int) $comment->comment_approved ) {
					return true;
				}
			}
		}

		if ( 0 === get_current_user_id() ) {
			return false;
		}

		if ( empty( $comment->comment_post_ID ) && ! current_user_can( 'moderate_comments' ) ) {
			return false;
		}

		if ( ! empty( $comment->user_id ) && get_current_user_id() === (int) $comment->user_id ) {
			return true;
		}

		return current_user_can( 'edit_comment', $comment->comment_ID );
	}
protected function check_read_permission ( $ comment ) { if ( ! empty ( $ comment -> comment_post_ID ) ) { $ post = get_post ( $ comment -> comment_post_ID ) ; if ( $ post ) { if ( $ this -> check_read_post_permission ( $ post ) && 1 === ( int ) $ comment -> comment_approved ) { return true ; } } } if ( 0 === get_current_user_id ( ) ) { return false ; } if ( empty ( $ comment -> comment_post_ID ) && ! current_user_can ( 'moderate_comments' ) ) { return false ; } if ( ! empty ( $ comment -> user_id ) && get_current_user_id ( ) === ( int ) $ comment -> user_id ) { return true ; } return current_user_can ( 'edit_comment' , $ comment -> comment_ID ) ; }
Check if we can read a comment.

@param  object  $comment Comment object.
@return boolean Can we read it?
Check if we can read a comment .