The order will take effect in two weeks, allowing the White House to appeal to the Supreme Court.