code: def has_role(self, role_or_handle):
          
          if not isinstance(role_or_handle, str):
              return role_or_handle in self.roles
  
          has_role = False
          for role in self.roles:
              if role.handle == role_or_handle:
                  has_role = True
                  break
  
          return has_role
docs: Checks if user has role