The district court erred in entering a nationwide injunction against the Trump Administration’s unlawful restrictions on federal grants to localities, requiring them to forego the grants or foreswear their “sanctuary” statutes or ordinances. The only plaintiffs in this case were San Francisco and California. They suffered injury only within California, and they could be restored to their rightful position by an injunction limited to California. An injunction should be no broader in terms or geographical scope than is necessary to afford complete relief to the plaintiffs before the court. So it was error to extend the injunction beyond California’s territorial limits.