How can I get the the name of author's role when editing post?

I have a user called "Tom",its role's name is "A".
I write the code like this:

$role = get_role( 'author' );
if($role->roles[0] == 'A')
{
	echo "success";
}

However,it print nothing.Please help me.