Index: wp-includes/user.php
===================================================================
--- wp-includes/user.php	(revision 21372)
+++ wp-includes/user.php	(working copy)
@@ -1487,3 +1487,23 @@
 	);
 	return apply_filters( 'user_contactmethods', $user_contactmethods, $user );
 }
+
+/**
+ * Retrieve the highest-order role for a user
+ *
+ * @access public 
+ * @since 3.5.0
+ *
+ * @param int|object $user User ID or data object (optional)
+ * @return string $user_role
+ */
+function wp_get_user_role( $user = null ) {
+	if ( is_int( $user ) )
+		$user = get_user_by( 'id', $user );
+	
+	if ( empty( $user->ID ) && get_current_user_id() )
+		$user = wp_get_current_user();
+		
+	if ( !empty( $user->roles ) )
+		return reset( $user->roles );
+}
\ No newline at end of file
Index: wp-admin/includes/ajax-actions.php
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 21372)
+++ wp-admin/includes/ajax-actions.php	(working copy)
@@ -1025,10 +1025,10 @@
 	$x = new WP_Ajax_Response( array(
 		'what' => 'user',
 		'id' => $user_id,
-		'data' => $wp_list_table->single_row( $user_object, '', $user_object->roles[0] ),
+		'data' => $wp_list_table->single_row( $user_object, '', wp_get_user_role( $user_object ) ),
 		'supplemental' => array(
 			'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
-			'role' => $user_object->roles[0]
+			'role' => wp_get_user_role( $user_object )
 		)
 	) );
 	$x->send();
Index: wp-admin/includes/class-wp-users-list-table.php
===================================================================
--- wp-admin/includes/class-wp-users-list-table.php	(revision 21372)
+++ wp-admin/includes/class-wp-users-list-table.php	(working copy)
@@ -193,7 +193,7 @@
 
 		$style = '';
 		foreach ( $this->items as $userid => $user_object ) {
-			$role = reset( $user_object->roles );
+			$role = wp_get_user_role( $user_object );
 
 			if ( is_multisite() && empty( $role ) )
 				continue;
Index: wp-admin/user-edit.php
===================================================================
--- wp-admin/user-edit.php	(revision 21372)
+++ wp-admin/user-edit.php	(working copy)
@@ -248,13 +248,11 @@
 <tr><th><label for="role"><?php _e('Role:') ?></label></th>
 <td><select name="role" id="role">
 <?php
-// Get the highest/primary role for this user
-// TODO: create a function that does this: wp_get_user_role()
-$user_roles = $profileuser->roles;
-$user_role = array_shift($user_roles);
 
+$user_role = wp_get_user_role( $profileuser );
+
 // print the full list of roles with the primary one selected.
-wp_dropdown_roles($user_role);
+wp_dropdown_roles( $user_role );
 
 // print the 'no role' option. Make it selected if the user has no role yet.
 if ( $user_role )
