In retrospect. That question was not definitively ruled on until Ex Parte Milligan in 1866.
It was definitively ruled on in Ex Parte Merryman by Chief Justice Taney. Its just that Lincoln being the unconstitutional tyrant that he was ignored the court order and signed an arrest warrant for the chief justice of the SCOTUS.