SandRat has an interesting post regarding Posse Commitatus and the use of the armed forces.
Wish I could remember the section of the US Code that he cites. Fairly certain it’s in Title X.
Posse Commitatus
The Posse Commitatus Act, while advisory and customary, is not equivalent to the Constitutional guarantee of border security to the several States. Further, the protections offered by Posse Commitatus, supposedly precluding the use of military force within the US are at best, illusory. I point you to USC Title X, Section 333:
The President, by using the militia or the armed forces, or both, or by any other means, shall take such measures as he considers necessary to suppress, in a State, any insurrection, domestic violence, unlawful combination, or conspiracy, if it
(1) so hinders the execution of the laws of that State, and of the United States within the State, that any part or class of its people is deprived of a right, privilege, immunity, or protection named in the Constitution and secured by law, and the constituted authorities of that State are unable, fail, or refuse to protect that right, privilege, or immunity, or to give that protection; or
(2) opposes or obstructs the execution of the laws of the United States or impedes the course of justice under those laws.
In any situation covered by clause (1), the State shall be considered to have denied the equal protection of the laws secured by the Constitution.
So you see, Congress gave the President the police power with enormous latitude well over 100 years ago, Constitutional or not (IMO, not).