Corporate America has made a lot of money by treating millions of workers as independent contractors, denying them basic legal protections enjoyed by employees.

California is now on the verge of taking an important step to curb that sham.

The State Assembly passed a bill Wednesday that imposes strict limits on who can be classified as a contractor. The State Senate has already passed the measure, and Gov. Gavin Newsom has said that he will sign it into law. Beginning next year, companies like Uber, Lyft and other giants of the gig economy would be forced to treat hundreds of thousands of workers as employees. The legislation creates a valuable template that other states should emulate, particularly in the face of the Trump administration’s efforts to reduce worker protections.

Contractors are workers paid by a company, but not protected by most workplace laws. They are not guaranteed a minimum wage, overtime pay or any other benefits, for example.

The use of contractors can serve a legitimate purpose, as when a company pays an expert to perform a specific task. But companies have taken advantage of the law, hiring large numbers of contractors whom they have treated as an inferior grade of employee.