Meanwhile, the Seventh Circuit rejected Chicago’s contention that minority firefighters were needed for credibility and cooperation in minority neighborhoods; separately, it ruled that hiring black counselors to deal with black disadvantaged youths was illegal because it catered to discrimination by clients and their parents.There are only two areas where courts have authorized racial realism. Some courts have argued that law enforcement creates a compelling interest — “operational needs” — in communication and legitimacy with nonwhites, justifying racial realism in the hiring and placement of police officers. And there have been some exceptions made for artistic license: In 2012, a Tennessee district court, in a case regarding the reality show “The Bachelor,” stated that casting only whites in the lead roles was expression, akin to speech, and protected by the First Amendment.

Not only is racial realism legally unjustified, but it often hurts the people who, in the short term, would seem to benefit from it. Studies by the sociologists Elijah Anderson and Sharon Collins have found that nonwhite employees who are promoted to fill racially defined roles have trouble leaving them.

Moreover in jobs where part of an employee’s salary is based on sales volume, assigning nonwhites to nonwhite market sectors — which tend to be lower income — can mean significantly smaller paychecks. In 2008, Walgreens agreed to pay $24 million to black managers who objected to being placed in black neighborhoods, which typically had lower sales and thus lower compensation.

Nevertheless, racial realism is too slippery, and too widely used, to stamp out completely. And so rather than trying to end racial realism, we need to make sure that it doesn’t block opportunities for minorities. For one thing, we could require more transparency and verification. If employers think race is a legitimate qualification for a job, they must rely on evidence, not stereotypes.

And in cases where racial-realist hiring and placement is justified, like after a series of racially fraught police incidents, there should be opt-outs and time limits.

This was the position of a New York district court when black police officers sued to limit Mayor Rudolph W. Giuliani’s ability to force them to work in a dangerous precinct after the 1997 beating of Abner Louima, a Haitian immigrant, by white police officers. Mayor Giuliani argued that the presence of black officers was necessary to ease racial tensions, and the court agreed — but also held that the placements had to be temporary.

America has changed significantly since the Civil Rights Act. But we are still a long way from the day when race no longer plays a role in society. Racial realism may be unavoidable for the time being, but we must still be wary of its excesses, lest it lead us back down the road toward racial discrimination.