Allowing users to view private posts (pending approval)

OK so I mostly fixed this myself I went into post.php in wp-includes. Changed the ‘protected’ => true, of pending to ‘public’ => true, but every time wordpress updates this will reset (I think) so can anybody mention a permanent way to make this change?

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