Under cover of night and in the final moments of the legislative session, lawmakers in Harrisburg robbed Philadelphia, Pittsburgh, and other communities of a weapon in their fight against gun violence. The legislature approved a bill allowing the National Rifle Association and others to sue cities and towns over gun ordinances - and, even more outrageously, forcing local governments to cover their legal costs.

The process was as questionable as the result. The provision was smuggled into an unrelated bill on metal theft, and at one point the Senate voted to bypass a good-government rule requiring it to end voting at 11 p.m.

The law will hamper local efforts to deal with illegal guns in a state that does little to help cities beset by violence. About 30 communities in Pennsylvania have passed laws requiring gun owners to tell police when weapons are lost or stolen. Responsible gun owners have no trouble with this requirement. The laws are aimed at so-called straw buyers, who purchase guns for felons who can't legally buy guns for themselves. About 85 percent of the murders in Philadelphia are committed with guns, many of them purchased illegally.

In 2008, the NRA sued the city over its requirement that lost or stolen guns be reported, but a court found that the group had no legal standing to carry out the lawsuit. The new state law explicitly gives "membership organizations" such as the NRA the right to sue communities that try to stem gun trafficking.

The act speaks to the power the NRA has over Pennsylvania's legislature and Gov. Corbett. The end of the legislative session also saw the group defeat a bid to end the state's barbaric pigeon shoots - even though that required killing a measure to ban the slaughter or sale of dogs and cats for human consumption.

Supporters of the lawsuit legislation say they acted on principle, including the Second Amendment right to bear arms and the Pennsylvania Constitution's provision that state law supersedes local ordinances. But should that principle supersede a person's ability to live without fear of serious injury or death due to gun violence? Is the right to bear arms the same as the right to buy arms for violent criminals? The legislature and governor also have a duty to families who lose loved ones to gun violence and live in neighborhoods where gunfire is routine.

In fact, this legislation wasn't about lofty principles at all. It was a gift to the NRA and the gun traffickers it protects. And it will allow more guns to get into the hands of those who would harm others.