Prevent third party plugin’s admin page access based on user type

It’s done with wp_die().

Something along these lines:


if ( $no_user_access ) {
wp_die( 'You do not have permission to access this page' );
}

See: https://developer.wordpress.org/reference/functions/wp_die/