def canPost(forum, user):
  """Determines whether the given user can post to this forum or not."""
  if not forum.allowed_posters:
    return True
  if not user:
    return True
  for poster in forum.allowed_posters:
    if poster.user_id() == user.user_id():
      return True
  return False