def METHOD_NAME(user: User) -> bool:
  """Return True if the current user is allowed to administer the site."""
  # A user is an admin if they have an AppUser entity that has is_admin set.
  if user:
    app_user = AppUser.get_app_user(user.email())
    if app_user is not None:
      return app_user.is_admin
  return False