Facebook has agreed to pay $10 million to charity to settle a class action suit over the social media site’s inclusion of a user’s “likes” of certain advertisers on “Sponsored Stories” that appeared on other members’ Facebook pages.

The plaintiffs contended that Facebook’s use of their names and profile pages in connection with the advertiser “like” without either payment or giving them a right to opt out violated their right of publicity under California state law, according to Reuters.

“California has long recognized a right to protect one’s name and likeness against appropriation by others for their advantage,” wrote U.S. District Judge Lucy Koh in court papers related to the settlement of the case. She also said the plaintiffs had demonstrated they could be economically harmed through Facebook’s use of their names and photos in this manner.

The Wall Street Journal Law Blog post about the settlement includes links to other documents in the case.