Check that a user is an administrator in Drupal

You can check that a user is an administrator or not like this:

if(user_access('administer'))
  echo 'I am an admin';
else
  echo 'I am not an admin';

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top