getRoles() public method

Get user roles for authentication
public getRoles ( ) : array
return array array with roles
Esempio n. 1
0
 /**
  * Log in user
  *
  * @param Newscoop\Entity\User $user
  * @param string               $providerKey
  *
  * @return UsernamePasswordToken
  */
 public function loginUser(User $user, $providerKey)
 {
     $roles = $user->getRoles();
     $token = new UsernamePasswordToken($user, null, $providerKey, $roles);
     $this->security->setToken($token);
     return $token;
 }