Elie Honig, a former federal and state prosecutor, is currently a CNN legal analyst and Rutgers University scholar. The views expressed in this commentary are his own. View more opinion articles on CNN.

(CNN) Friday's ruling by US District Court Judge Timothy Kelly -- a 2017 appointee of President Donald Trump -- requiring the White House to return CNN chief White House correspondent Jim Acosta's "hard pass" struck an important victory for the free press.

If it wasn't clear to the White House before, it should be now: the administration picked an absurd fight spurred by a presidential temper tantrum, dug into an untenable position, and is now very far out on a very thin branch in the courts.

Elie Honig

By basing his ruling on procedural due process rather than substantive First Amendment grounds, Judge Kelly stopped just short of delivering a full vindication of the constitutional right of free press, but he went far enough to make clear where the case is headed.

As a basic principle, anytime the government takes away a person's rights or property, it must afford that person some level of process (hence, "due process"); the extent of the required process depends on the importance of the rights or property at issue. Judge Kelly ruled that the White House took away Acosta's hard pass with essentially no process.

Indeed, the Department of Justice lawyer who argued the case for the administration conceded at oral argument that "there doesn't need to be a reason" for revoking press credentials because "the President has broad discretion." In other words, the President can do whatever he wants, for any reason he wants, and nobody can do anything about it. In his ruling Friday, Judge Kelly firmly disagreed.