Yesterday the National Rifle Association filed a First Amendment lawsuit against the city of San Francisco, arguing that an anti-NRA resolution recently approved by the Board of Supervisors violates the constitutional rights to freedom of speech and freedom of association. By threatening to cut off government contractors with ties to the NRA, the complaint says, the city is retaliating against the organization for its political advocacy and chilling the speech of its supporters.

The resolution, which the supervisors unanimously approved last week, absurdly describes the NRA as a “domestic terrorist organization.” Its sponsor, Supervisor Catherine Stefani, is a vehement critic of the NRA who views the organization as the chief obstacle to the gun control laws she favors.

“Such advocacy is Stefani’s constitutional right,” the NRA says. “But just as the Constitution entitles her to criticize and debate the NRA, it forbids her from wielding the powers of her office to suppress or retaliate against the NRA’s exercise of its First Amendment rights….Far from protected government speech, Defendants’ actions constitute a ‘threat[] to employ coercive state power’ against NRA members and entities doing business with the NRA.”

The lawsuit asks for an injunction to prevent enforcement of the resolution, which urges city officials to “assess the financial and contractual relationships our vendors and contractors have” with the NRA and “limit those entities who do business with the City and County of San Francisco from doing business with this domestic terrorist organization.” Insofar as that edict affects contractors who are sympathetic to the NRA, it violates the principle established by the U.S. Supreme Court in the 1996 case Board of County Commissioners v. Umbehr. “The First Amendment protects independent contractors from the termination of at-will government contracts in retaliation for their exercise of the freedom of speech,” the Court said in that decision.

The NRA also argues that the city would be violating the First Amendment by forcing contractors to “publicly disclose affiliations that are disfavored by some, and which have no relation whatsoever to the ability of a vendor or contractor to perform requested services or provide requested goods under a government contract.” That sort of inquisition, it says, unconstitutionally compels speech and “would chill a person of ordinary firmness from continuing to speak against gun control, or from associating expressively or commercially with the NRA.”

More broadly, the complaint says, the resolution, which is expressly aimed at undermining the NRA’s influence, is a form of illegal retaliation for constitutionally protected speech. By forcing contractors to “choose between maintaining their relationships with the NRA and keeping or obtaining government contracts,” the complaint says, the city would deprive the organization of services it could otherwise obtain. That is similar to the NRA’s argument in its lawsuit against New York Gov. Andrew Cuomo (D) over his attempts to bully state-regulated banks and insurers into shunning the group.

When he allowed the New York lawsuit to proceed last year, Judge Thomas McAvoy of the U.S. District Court for the Northern District of New York observed that the governor seemed to be sending “the message that insurers and financial institutions that do not sever ties with the NRA will be subject to retaliatory action by the state.” That message, McAvoy ruled, “provides a sufficient basis to invoke the First Amendment.”

Notably, Stefani’s main defense against the NRA’s constitutional claims seems to be that the supervisors didn’t really mean it. “It’s a resolution,” she told The New York Times. “It’s not an ordinance. It’s nonbinding.” But even the threat of scrutinizing contractors for ties to the NRA can be expected to have a chilling effect, and any attempt to follow through on the aspiration to stop contractors from doing business with the organization would implicate the First Amendment.

People who support gun control and/or hate the NRA may be inclined to applaud the San Francisco resolution. They probably would feel differently about a similar resolution, approved by legislators in a more conservative city, that targeted, say, Black Lives Matter or NARAL Pro-Choice America. Aside from the poisonous tendency to portray one’s political opponents as mass murderers, San Francisco’s resolution embodies the view that constitutional principles are worth respecting and defending only when they help people you like—in which case they are not principles at all.