Drupal - Check if a User has a specific role
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.
}
?>
This helped out so much!...
This helped out so much!
Post new comment