In democracy, government is about protocol.

Ignoring official procedures to protect core rights can result in a free-wheeling president like Donald Trump getting his authority questioned and his wings clipped.

That’s what happened Friday when U.S. District Judge Timothy J. Kelly ordered the White House to return CNN reporter Jim Acosta’s press pass revoked on Nov. 7 after Trump’s tiff over Acosta’s persistent effort to ask a follow-up question about the Russian investigation at an East Room news conference.

The White House promptly complied with the court order but also vowed to continue the legal fight.

The judge’s decision granted CNN’s request for a temporary restraining order returning Acosta’s press pass until the cable network’s lawsuit is settled accusing the president, his aides and the Secret Service of violating the reporter’s First Amendment and Fifth Amendment rights. That could take months.

The restraining order was the initial legal chapter of the press versus the president case, causing journalists to declare a victory even though the judge’s reasons gave little weight to the argument Acosta had a First Amendment right to his White House press pass.

The judge appeared to agree with the president’s lawyers there’s no constitutional guarantee granting journalists’ access to the White House grounds, but once they’re allowed in, they can’t be arbitrarily kicked out.

His decision temporarily reinstating Acosta’s press pass rested mainly on the Fifth Amendment’s due process clause protecting the reporter’s right to a fair process to dispute losing his credential.

CNN called it a victory for the free press. Acosta thanked the many news organizations, including Fox News, for supporting him in the legal challenge. “Let’s go to work,” he said after emerging from the courtroom.

Judge Kelly, who was appointed to the federal bench by Trump, urged caution in interpreting his decision.

“I want to emphasize the very limited nature of this ruling,” said Kelly. “I have not determined that the First Amendment was violated here.”

His ruling primarily determined the White House’s decision to strip Acosta of his press pass failed to meet the constitutional standard of due process. He said the action was “so shrouded in mystery” it was not clear who even made the decision.

Trump’s attorneys had argued the White House revoked Acosta’s press pass because of his “showboating” and disruptive manner in general and particularly at the recent press conference. The CNN reporter refused to sit down and turn over his microphone to an intern when asked to do so, causing the president to call him a “rude, terrible person.”

Lack of White House rules governing Acosta’s personal deportment and the absence of a transparent process for settling the dispute over his press pass seemed to register with the judge.

Yet his language was also seen as favorable by Trump. He said his lawyers would write rules of conduct for White House journalists that satisfy due process requirements when punitive action is deemed necessary against unruly journalists.

“We’re setting up a certain standard, which is what the court is requesting,” said Trump. “People have to behave … you have to act with respect when you’re at the White House.”

Respect, to be effective, has to be a two-way standard. Trump delights in calling journalists and news organizations critical of his conduct and decisions “enemies of the people” and purveyors of “fake news.”

That’s not respectful language. It is spiteful denigration of an American institution the nation’s founders saw as necessary to hold government accountable in a democratic society.

Bill Ketter is senior vice president of news for CNHI. Contact him at wketter@cnhi.com.