States may force public sector labor unions to get consent from workers before using their fees for political activities, the Supreme Court said Thursday.

The Court unanimously upheld a Washington state law that applied to public employees who choose not to join the union that represents them in contract talks with state and local governments. The workers are compelled to pay the equivalent of union dues, a portion of which the union uses for political activities.