In the US, all government power is derived from the US Constitution. The 3rd and 5th Amendments provide some protections of civilians from the military. But in practice, all civil rights only exist to the extent that they can be enforced. When martial law is enacted, there are no civil rights protections.