The justices have been asked to rule on whether the president can appoint allies as top prosecutors.