Check user is an admin in drupal global $user; // Check to see if $user has the administrator role. if (in_array('administrator', array_values($user->roles))) { // Do something. }
Post a Comment