global $user;

// Check to see if $user has the administrator role.
if (in_array('administrator', array_values($user->roles))) {

// Do something.

}
Advertisements