phpauthenticationdrupaldrupal-7drupal-modules

How to get the currently logged in user's role in Drupal 7?


How to get the currently logged in user's role in Drupal 7 ? Do you know a simple way of accomplish this ? Is there some drupal core functions for this?


Solution

  • You can access to the user roles by just using this PHP snippet:

    <?php $GLOBALS['user']->roles; ?>