public function getRoles()
{
if (!$this->isLoggedIn()) {
return [$this->guestRole];
}
$identity = $this->getIdentity();
return $identity && $identity->getRoles() ? $identity->getRoles() : [$this->authenticatedRole];
}
private function extractRoles() { $userRoles = $this->user->getRoles(); if ($this->roleHierarchy) { return $this->roleHierarchy->getReachableRoles($userRoles); } return $userRoles; }