Hide custom post type by user roles

as @Tonydjukic mentioned, the best way is get user role first and then showing content to him.

also with this code we can do it :

$user = wp_get_current_user();
$allowed_roles = array( 'administrator', 'customer' );
if ( array_intersect( $allowed_roles, $user->roles ) ) {
}