wp query add array by if condition

It looks like you are trying to access the $lava_listing_posts_args array from a different file (and class). You would need to pass it as an argument of your action.

Although you could do this with actions since you are simply modifying the array you should probably use filters (actions and filters are essentially the same thing, just used differently)

Instead of calling do_action, filter the array like this:

$lava_listing_posts_args = apply_filters( 'lava_lv_support_list_output_restrict', $lava_listing_posts_args );

Then in your addon class, hook on to your filter like this:

add_filter( 'lava_lv_support_list_output_restrict', Array( $this, 'lava_list_output_restrict' ) );

Pass the array to your function as an argument like this (and return the array once you’re finished with it):

public function lava_list_output_restrict( $lava_listing_posts_args ) {

    // Do stuff with $lava_listing_posts_args
    return $lava_listing_posts_args;
}

As as aside, I’m not sure exactly what you’re trying to do with this code:

if( !array_intersect($allowed_roles, $user->roles ) ) {
    $get_current_user_id = get_current_user_id( );
    $author_check= array('author'=> $get_current_user_id);
    $lava_listing_posts_args['author'] = $author_check;
    $lava_listing_posts_args = array_merge($lava_listing_posts_args, $author_check);
}

It seems to me most of that is unnecessary and all you are really doing is:

if( !array_intersect( $allowed_roles, $user->roles ) ) {
    $lava_listing_posts_args['author'] = get_current_user_id();
}