code: public function hasRole($role)
      {
          foreach ($this->roles as $k => $r) { 
              $roles[$k] = $r instanceof RoleInterface ? $r->getRole() : (string) $r;  
          } 
          $roles = array_flip(array_flip($roles));
          
          return in_array($role, $roles);
      }
docs: @param string $role
  
  @return boolean