You and he are quite possibly correct.
After reading thru the TRO, it seems to rest on a violation of due process, which itself would be a violation of the 14th Amendment.
The fourteenth amendment to the constitution is not confined to the protection of only citizens. It says: "Nor shall any state deprive any person of life, liberty, or property without due process of law; nor deny to any person within its jurisdiction the equal protection of the laws."
In short, the President seems to have the authority to such restrictions, however he must still follow due process. Anyone already issued valid visas, green cards, etc. can't be summarily barred by fiat and those permits can't be revoked without following the legal process.