The story is part of New York City’s public policy lore.

Robert Hayes was a 26-year-old Wall Street attorney when he took on a pro bono case that would redefine the way New York City handles homelessness.

His work on Callahan vs. Carey would result in a 1981 consent decree that would establish the foundation for the right-to-shelter rules that require the city to provide a bed to anyone who asks for one. It was the biggest legal victory in history for homeless New Yorkers.

Now, the crux of that decree may soon come into question. Mayor Eric Adams announced on Tuesday that the city has asked a judge to reconsider the practice, which is over four decades old. Since last year, Adams has been struggling to provide shelter for tens of thousands of migrants arriving in the city from the southern border.

Adams is now arguing that the challenge of having to provide shelter for more than 40,000 migrants was something the city “never contemplated, foreseeable or indeed even remotely imagined.”

Lawmakers and advocates were sharply critical of the mayor’s actions. City Comptroller Brad Lander described it as an “attempt to abdicate its responsibility.” The Coalition for the Homeless, which Hayes helped found, said it planned to oppose the mayor’s court motion.

But as he drove his car on Tuesday night, Hayes, who now works on health care issues, paused to reflect when asked for his reaction to the news. He briefly worked as a reporter, but remains a lawyer at heart.

“I am completely confident that the Coalition for the Homeless and its lawyers will vigorously defend the right to shelter,” he said.

But Hayes became angry when pressed to say more about the decision.

“I think it’s shameful. I think it’s cowardly,” he said. “There will be at least two generations of judges who have worked on these courts who would roll on their graves if the court ceded to the mayor’s requests.”

His interest in tackling homelessness began when he was a student at NYU Law School. During morning runs at Washington Square Park, he’d come across homeless men asking for money and wondered why the city wasn’t doing more to help them. He tried approaching city officials but was rebuffed. And so, as a young attorney, he decided to go to court.

The pro bono case led to others. Soon enough, Hayes became known as the city’s crusader for the homeless.

Hayes has experience with mayors who have tried to undo the right to shelter. Ed Koch and Rudy Giuliani attempted to weaken or get around the rules. Both lost.

“The first winter that the consent decree was enacted, it got cold,” he said. “The Koch administration used almost the same words Adams is.”

According to his recollection, the judge’s response was: “This consent decree is not written in water. Obey it.”

As for what he thinks might happen this time, Hayes said that his argument for the right to shelter rule was premised on a provision in the state constitution that came out of the Great Depression. It states that “the aid, care and support of the needy are public concerns.”

What that means, he argued, is that the state and city have a responsibility to protect people in dire need. And while he acknowledged that the migrant crisis has challenged the mayor with a difficult and unforeseen circumstance, he asked, “What could be tougher than the Great Depression?”

“The only time constitutional rights really matter are during hard times,” he added.