How to hide private posts even if user is admin

I can’t use is_singular( 'my_post_type' ) in pre_get_posts because the queried object is not set at this point.
I can use instead the post_type query parameter.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)