A San Francisco judge dismissed a case against Apple Inc. filed by its retail employees seeking compensation for the time they spend undergoing bag checks before leaving work every day.

Agreeing with Apple’s attorneys Judge William Alsup said Saturday: “Workers were free to choose to avoid searches by not bringing bags with them.”

The ruling frees Apple from the long-running class action suit covering former and current employees throughout California, who objected to the bag checks at meal breaks and after their shifts.

"Plaintiffs are disappointed in the court's ruling and are exploring their options, including an appeal," Lee Shalov, a lawyer for the workers, said in an email to Bloomberg.

The case began in 2013, when plaintiffs Amanda Frlekin and Dean Pelle -- former Apple Store employees -- complained that Apple searched employees' bags every time store workers left an outlet, to discourage merchandise theft. The case was given class action status in July, broadening the potential impact to over 12,000 past and present staff at the company's retail outlets.

Earlier court filings had noted that at least two Apple Store workers complained directly to CEO Tim Cook about the searches, calling them demeaning. 

"The choice is one of convenience, and it's entirely the employees'," Apple lawyer Julie Dunne told the court. "It might be far less convenient to leave it at home, but that's their choice," she said.

Last year the U.S. Supreme Court rejected claims by former Amazon.com Inc. warehouse workers and said that workers don’t have a federal right to be paid for time spent in security searches that occur when their shift ends.