Check if current user role is..

How to check if current user role is administrator or editor or author etc. below the function how I check it in wordpress.


function check_current_user_role( $role ) {
$user = wp_get_current_user();
if( in_array($role, (array) $user->roles) )
return true;
else
return false;
}