Do you wonder why some users at WooCommerce enabled site have access to the top admin bar and WordPress admin dashboard, but some users don’t?
It is by design: WooCommerce plugin developers decided for us for whom they allow access to WordPress admin dashboard and for whom they prohibit it. But thanks them for the professionalism – it is possible to change that default WooCommerce logic via special filters.
Garagulya, V., (2015) Woocommerce Admin Bar Access
/**
* Allow the "CUSTOM_ROLE" role access to the WordPress Admin
*
* @param boolean $prevent_access
* Woocommerce parameter.
* -true: doesn't have access
* -false: have access
*
* @return boolean
* If woocommerce prevent the access to the admin bar.
*/
function allow_CUSTOM_ROLE_wp_admin_access($prevent_access)
{
# If the current is is not the patrocinador, do nothing
if( !is_current_user_CUSTOM_ROLE() )
return $prevent_access;
# Woocommerce ask itself, "prevent this user to access to the WordPress Admin?"
return false;
}
add_filter( 'woocommerce_prevent_admin_access', 'allow_CUSTOM_ROLE_wp_admin_access');