Disable Woocommerce checkout based on user role [closed]

Woocommerce is considered off-topic here but as a general answer, it is considered best practice to check against capabilities instead of roles

In WP, this is done like that:

add_action('init', 'wpse_capability_check');  // hooked on 'init' but depends on your actual code logic
function wpse_capability_check(){

  // you should check on a capability that only validated user have
  if( current_user_can( 'validated_user_cap' ) {
    // DO STUFF HERE FOR VALIDATED USERS
  }

  // you should check on a capability that only invalidated user have
  if( current_user_can( 'invalidated_user_cap' ) {
    // DO STUFF HERE FOR INVALIDATED USERS
  }

}

check out https://codex.wordpress.org/Function_Reference/add_cap to know how to add capabilites to roles

This doesn’t mean you can’t add new roles with your custom cap, but your logic should depend on capability and not roles

BONUS: same logic applies here, you check on the user capability when the checkout process is triggered. You might have another check function hooked on that process