Custom Post Type only display items created by user

Instead of coming up with this functionality myself and re-inventing the wheel I’m using the built-in functionality that makes a post ‘private’.

By using this I’ve had to force all posts to be private, I’ve done so using the wp_insert_post_data filter:

add_filter('wp_insert_post_data', array($this, 'post_data_save'), 10, 2);

And my method:

public function post_data_save($post){
    if($post['post_type'] == 'my_custom_post_type'){
        switch($post['post_status']){
            case 'publish': $post['post_status'] = 'private'; break;
        }
    }
    return $post;
}