Show only pages you are author of

To show only pages that a user is the author, I use the pre_get_posts action to alter the query.

add_action( 'pre_get_posts', function ( $wp_query ) { 
    
    $user = wp_get_current_user();
    global $pagenow;

    if ( !empty($user->roles) ) {

        // BackEnd AND Entity "Page" AND "any role other than administrator" AND not New post
        if ( is_admin() && 'page' == $wp_query->query['post_type'] && !in_array( 'administrator', (array) $user->roles ) && !in_array($pagenow, ['post.php', 'post-new.php']) ) {
            $wp_query->set( 'author', $user->ID );
            add_filter( 'views_edit-page', '__return_empty_array' ); // To hide filters in top of the list page ( All(X) | Publish(X) | Draft(X) )
        }

    }
});