New York has outlawed discrimination based on natural hair and hairstyles associated with race like braids, twists and dreadlocks.

The new law effectively prevents employers and schools from requiring workers or students to straighten their hair or setting a dress code that prevents braids, dreadlocks or similar hairstyles "historically associated with race."

Gov. Andrew Cuomo, who signed the legislation into law Friday, described it as an important step in correcting past failures to protect against all forms of discrimination.

"For much of our nation's history, people of color — particularly women — have been marginalized and discriminated against simply because of their hair style or texture," Cuomo said.

One example of hair-based discrimination unfolded in Westchester County, where a clothing store manager told a worker her braids were "too urban and unkempt" in 2017.

The Banana Republic manager, who suggested the employee try Shea butter on her hair, was fired after USA TODAY Network reported on the incident, which involved a 19-year-old SUNY Purchase student employed as a sales associate at the national clothing chain.

What's the new law?

The new law expands the legal definition of race to include "ancestry, color, ethnic group identification and ethnic background," including any "traits historically associated with race" such as "hair texture and protective hairstyles."

Examples of "protective hairstyles" are braids, locks and twists, among others, according to the law.

The same definition would also be added to the state Dignity For All Students act, which deals with bullying in schools.

New York is the second state to outlaw the hair-based discrimination, joining California that enacted a law earlier this month. New York City's Commission on Human Rights has also issued similar anti-discrimination guidelines.

New York state legislators said the law addresses the harm done to educational and employment opportunities.

"No one should face discrimination at school or in the workplace, but too often we see people of color, particularly women, who are told their hair is unprofessional or not appropriate in public settings," Assembly Speaker Carl Heastie, D-Bronx, said in a statement.

Prior to adding the hair-related protections, New York state law prevented employer discrimination based on a variety of traits, including age, race, creed, sex and color.

Senate Majority Leader Andrea Stewart-Cousins, D-Yonkers, said, "We should celebrate the diversity that makes New York State great and that includes respecting the hair style choices of all New Yorkers."

More: How black journalists were inspired to follow their career paths

More:New York state could outlaw discrimination based on hair