If you want to see the difference between a federal judge who follows the rule of law and a federal judge who ignores laws he doesn’t like in order to reach a preferred public policy outcome, just compare the two district court decisions issued in Washington state and Massachusetts over President Donald Trump’s immigration executive order.

Contrary to the “travel ban” label, the executive order temporarily suspended the granting of visas from seven failed and failing countries that are supplying many of the terrorists plaguing the world.

Despite what Judge James Robart of the Western District of Washington says, Trump acted fully within the statutory authority granted to him by Congress. The temporary restraining order issued by Robart on Feb. 3 is unjustified and has no basis in the law or the Constitution.

This fact is obvious from an examination of his seven-page order, which contains absolutely no discussion whatsoever of what law or constitutional provision the president has supposedly violated. That temporary restraining order is now on an emergency appeal before a panel of the 9th U.S. Circuit Court of Appeals.

Contrast that with the 21-page opinion issued by Massachusetts District Court Judge Nathaniel Gorton that was also issued on Feb. 3.

Unlike Robart, who totally ignored the federal statute (8 U.S.C. §1182(f)) cited by Trump in his executive order, Gorton bases his decision denying the temporary restraining order on an examination of the extensive power given to the president under that statute, which gives the president the authority to suspend the entry of any aliens or class of aliens into the U.S. if he believes it “would be detrimental to the interests of the United States.” And he can do so “for such period as he shall deem necessary.”

That is exactly what the president has done. The order signed on Jan. 27 on “Protecting the Nation From Foreign Terrorist Entry Into the United States” suspends for 90 days the issuance of visas to anyone trying to enter the U.S. from seven countries that even the Obama administration identified as “countries of concern” because of their terrorism histories.

This has been done, as Gorton explains and as the administration has made clear, in order to “ensure that resources are available to review screening procedures and that adequate standards are in place to protect against terrorist attacks.”

As Gorton notes, “the decision to prevent aliens from entering the country is a ‘fundamental sovereign attribute’ realized through the legislative and executive branches that is ‘largely immune from judicial control.’”

As the U.S. Supreme Court said in 2004 in U.S. v. Flores-Montano, “The government’s interest in preventing the entry of unwanted persons and effects is at its zenith at the international border.”

In this case, Congress—which under the Constitution has complete authority over immigration—passed a statute providing the president the authority to suspend the entry of aliens into the country.

According to Gorton, in “light of the ‘plenary congressional power to make polices and rules for exclusion of aliens … which pursuant to 8 U.S.C. 1182(f), has been delegated to the president, the court concludes that the government’s reasons, as provided in the [executive order], are facially legitimate and bona fide.”

No federal judge, including Robart, has the authority to substitute his judgment for that of the president when it comes to making a decision on what is detrimental to the national security and foreign policy interests of the nation.

But that is exactly what he did.

Robart’s opinion ends with a claim that seems like a joke.

He says that “fundamental” to his work is “a vigilant recognition that [the court] is but one of three equal branches of our federal government. The work of the court is not to create policy or judge the wisdom of any particular policy promoted by the other two branches.”

Instead, says Robart, his job is “limited” to “ensuring that the actions taken by the other two branches comport with our country’s laws, and more importantly, our Constitution.”

Yet Robart provides no discussion of the Constitution or the federal statute that applies to this executive order and the actions of the president.

Given that there is no legal basis for his decision and the issuance of a temporary restraining order, the only basis for his decision is his judgment on the “wisdom” of Trump’s executive order.

Gorton recognized the public policy choices being made with this executive order. He discussed the “considerations of both sides with respect to a balancing of the hardships” involved.

On one side, the government is trying to implement “an effective immigration regime that ensures the safety of all Americans,” something that is “undoubtedly difficult.” On the other side, there is a “hardship to the professional and personal lives” of aliens trying to enter the country.

But it is not up to a judge to make that policy choice. The judge’s only role is to review whether the president’s action is authorized by the Constitution and federal law.

There is no question that the executive order meets both of those requirements. We can only hope that the 9th Circuit Court of Appeals follows the law and does not make the same mistake that Robart made.