Last active
June 29, 2016 10:22
-
-
Save zuhairkareem/ac499d9798b9c851795fcc8d4bfeedd4 to your computer and use it in GitHub Desktop.
To get current user's roles in D8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$userCurrent = \Drupal::currentUser(); | |
$user = Drupal\user\Entity\User::load($userCurrent->id()); | |
$roles = $user->getRoles(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment