public function hasRoleByName(string $roleName): bool
    {
        if (\in_array($roleName, \array_column($this->roles, 'name'), true)) {
            return true;
        }

        return false;
    }
public function hasRoleByName(string $roleName): bool
    {
        if (\in_array($roleName, \array_column($this->roles, 'name'), true)) {
            return true;
        }

        return false;
    }
public function hasRoleByName ( string $ roleName ) : bool { if ( \ in_array ( $ roleName , \ array_column ( $ this -> roles , 'name' ) , true ) ) { return true ; } return false ; }
Check if an user has a role, use role name.

@param string $roleName

@return bool
Check if an user has a role use role name .