src/Defender/Defender.php
public function hasRoles($roles)
    {
        if (! is_null($this->getUser())) {
            return $this->getUser()->hasRoles($roles);
        }

        return false;
    }
public function hasRoles($roles)
    {
        if (! is_null($this->getUser())) {
            return $this->getUser()->hasRoles($roles);
        }

        return false;
    }
public function hasRoles ( $ roles ) { if ( ! is_null ( $ this -> getUser ( ) ) ) { return $ this -> getUser ( ) -> hasRoles ( $ roles ) ; } return false ; }
Return if the authenticated user has any of the given roles.

@param string $roles

@return bool
Return if the authenticated user has any of the given roles .