If the law means anything, the Trump administration will succeed in overturning the so-called court ruling against its travel ban.

The nationwide stay of the ban issued by Judge James Robart, a Washington state-based federal district judge, is tissue-thin. It doesn’t bother to engage on the substance, presumably because facts, logic and the law don’t support Robart’s sweeping assertion of judicial authority in an area where judicial power is inherently quite limited.

This doesn’t justify President Donald Trump tweeting that Robart is a “so-called judge.” That slam earned Trump bipartisan blowback and may encourage other judges to tilt against Trump’s ban in response to a perceived threat to the independence of the judiciary. But Robart’s handiwork is shoddy and usurpatory, despite the fact that he is indeed a literal judge.

Even if you assume that the states of Washington and Minnesota have standing to pursue the litigation (Robart asserts implausibly that they “face immediate and irreparable injury” from the executive order, the heart of which is a three-month pause on most travel from seven countries), the stay falls down. It ignores our constitutional scheme and Supreme Court precedent, as the Justice Department brief seeking to reverse it persuasively argues.

First, Judge Robart is trespassing on a core executive responsibility. “The exclusion of aliens is a fundamental act of sovereignty,” the Supreme Court held in the 1950 Knauff case, “inherent in the executive power to control the foreign affairs of the nation.” The courts are not meant to second guess the executive’s conduct of foreign affairs, or intrude on its plenary power in this area. “It is not within the province of any court,” the court noted in that decision, “unless expressly authorized by law, to review the determination of the political branch of the Government to exclude a given alien.”

Second, it’s hard to get around the relevant federal immigration law, which says, “Whenever the President finds that the entry of any aliens or of any class of aliens into the United States would be detrimental to the interests of the United States, he may by proclamation, and for such period as he shall deem necessary, suspend the entry of all aliens or any class of aliens as immigrants or nonimmigrants, or impose on the entry of aliens any restrictions he may deem to be appropriate.”

This is as explicit and wide-ranging as it gets. When the president has such authorization from Congress, the Supreme Court held in the Youngstown Steel case in 1952, his “authority is at its maximum, for it includes all that he possesses in his own right plus all that Congress can delegate.”

Finally, aliens residing outside the United States have no right to come here. The Supreme Court held in the 1982 Landon case, “an alien seeking initial admission to the United States requests a privilege and has no constitutional rights regarding his application, for the power to admit or exclude aliens is a sovereign prerogative.”

It’s not clear how Judge Robart expects opponents of the Trump ban to overcome these substantial and well-established obstacles. A more extensive and carefully reasoned decision by a Massachusetts-based district judge reached the opposite conclusion of his.

It is true that the ultimate source of the Trump executive order is his ill-advised call for a Muslim ban during the campaign. But the executive order, focusing on seven war-torn or hostile countries that had already been singled out for special scrutiny during the Obama administration, is manifestly not a Muslim ban.

Judge Robart may not like the Trump policy, but that doesn’t mean that it is illegal or unconstitutional. His ruling is worthy of the generally unhinged opposition to President Trump. If the judge doesn’t deserve the abuse that Trump heaped on him on Twitter, he produced what should rightly be considered so-called jurisprudence.