During World War II, the United States government did claim the authority to restrict individual rights in favor of public safety, and this was upheld by the Supreme Court in several landmark cases. However, the Constitution itself does not explicitly grant this authority.
Instead, the government relied on the doctrine of "emergency powers," which are powers that are implied by the Constitution but not specifically enumerated. The Supreme Court has recognized that in times of war or national emergency, the government may have broader powers to protect national security and public safety, even if this involves some restriction of individual rights.
For example, in the case of Korematsu v. United States (1944), the Supreme Court upheld the forced relocation and internment of Japanese Americans during World War II, even though this violated their constitutional rights. The Court reasoned that the government's interest in national security outweighed the individual rights of Japanese Americans.
However, it is worth noting that these decisions have been widely criticized as violations of civil liberties and human rights, and the government's use of emergency powers has been controversial throughout American history. Ultimately, the question of when and how the government can restrict individual rights in the name of public safety remains a subject of ongoing debate and interpretation.