Here is a quick way to determine if a user has a specific role
<?php
// Bring the user object into scope.
global $user;
// Check to see if $user has the administrator user role.
if (in_array('administrator', array_values($user->roles))) {
// Do something.
}
?>