Return to Snippet

Revision: 50022
at August 4, 2011 15:16 by focal55


Initial Code
<?php
  global $user;

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

Initial URL

                                

Initial Description

                                

Initial Title
Drupal Check if User Has Role

Initial Tags
drupal, user

Initial Language
PHP