Posted By

focal55 on 08/04/11


Tagged

drupal user 6 roles


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

zack


Drupal Check if User Has Role


 / Published in: PHP
 

  1. <?php
  2. global $user;
  3.  
  4. // Check to see if $user has the administrator role.
  5. if (in_array('administrator', array_values($user->roles))) {
  6. // Do something.
  7. }
  8. ?>

Report this snippet  

You need to login to post a comment.