Obama did with Iraq refugees due too terrorism in 2011.Yet Obama has never implemented the law because it was unconstitutional.
Such acts have been officially deemed unconstitutional as per the Immigration and Nationality Act of 1965.
Also Trump executive order isn't deemed unconstitutional.
Cato Institute’s David J. Bier claims the temporary suspension is illegal because, in his view, it flouts the Immigration and Nationality Act of 1965. This contention is meritless, both constitutionally and as a matter of statutory law.
[…]
Mr. Bier asserts that Trump may not suspend the issuance of visas to nationals of specific countries because the 1965 immigration act “banned all discrimination against immigrants on the basis of national origin.” And, indeed, a section of that act, now codified in Section 1152(a) of Title 8, U.S. Code, states that (with exceptions not here relevant) “no person shall receive any preference or priority or be discriminated against in the issuance of an immigrant visa because of the person’s race, ***, nationality, place of birth, or place of residence” (emphasis added).
Even on its face, this provision is not as clearly in conflict with Trump’s executive order as Bier suggests. As he correctly points out, the purpose of the anti-discrimination provision (signed by President Lyndon Johnson in 1965) was to end the racially and ethnically discriminatory “national origins” immigration practice that was skewed in favor of Western Europe. Trump’s executive order, to the contrary, is in no way an effort to affect the racial or ethnic composition of the nation or its incoming immigrants. The directive is an effort to protect national security from a terrorist threat, which, as we shall see, Congress itself has found to have roots in specified Muslim-majority countries. Because of the national-security distinction between Trump’s 2017 order and Congress’s 1965 objective, it is not necessary to construe them as contradictory, and principles of constitutional interpretation counsel against doing so.
[…]
Federal immigration law also includes Section 1182(f), which states: “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”
[…]
Trump’s executive order also expressly relies on an Obama-era provision of the immigration law, Section 1187(a)(12), which governs the Visa Waiver Program. This statute empowers the executive branch to waive the documentation requirements for certain aliens. In it, Congress itself expressly discriminates based on country of origin.
Under this provision, Congress provides that an alien is eligible for the waiver only if he or she has not been present (a) in Iraq or Syria any time after March 1, 2011; (b) in any country whose government is designated by the State Department as “repeatedly provid[ing] support for acts of international terrorism”; or (c) in any country that has been designated by the Department of Homeland Security as a country “of concern.”