src/User.php
public function hasRole($name)
    {
        foreach ($this->roles as $role)
        {
            if ($role->name == $name) return true;
        }
        return false;
    }
public function hasRole($name)
    {
        foreach ($this->roles as $role)
        {
            if ($role->name == $name) return true;
        }
        return false;
    }
public function hasRole ( $ name ) { foreach ( $ this -> roles as $ role ) { if ( $ role -> name == $ name ) return true ; } return false ; }
Does the user have a particular role?

@param $name
@return bool
Does the user have a particular role?