function shapeSpace_remove_toolbar_menu() {
global $wp_admin_bar;
// remove menu for editor and author
if( current_user_can( 'editor' ) || current_user_can( 'author' ) ){
$wp_admin_bar->remove_menu('site-name');
}
}
add_action('wp_before_admin_bar_render', 'shapeSpace_remove_toolbar_menu', 999);
All Roles:
current_user_can( 'administrator' )
current_user_can( 'editor' )
current_user_can( 'author' )
current_user_can( 'contributor' )
current_user_can( 'subscriber' )