Unconstitutional
Maryland files federal court challenge asking judge to block Whitaker, install Rosenstein
That power belongs exclusively to the President, with the advice and consent of the Senate. The President (and only the President) chooses who can serve as Attorney General and the Senate confirms them. The AG can be fired by the President or impeached by Congress, but the courts have no jurisdiction.
The courts can rule on the actions of the AG, but that's it.
It's called separation of powers and it's worked pretty well so far.
What's more, no Democrat president would stand for it. So why should Trump?