Apple Inc. should have paid its store employees for time spent undergoing security checks of bags they bring to work, according to a California Supreme Court decision on Thursday.

The ruling comes more than two years after the U.S. Court of Appeals for the Ninth Circuit sought clarification in a class action brought by Apple store workers in California, who sought pay for the time spent waiting for and undergoing anti-theft searches of their bags and Apple devices before leaving work. Apple argued that the searches, while mandatory, were not required if employees simply did not bring bags to work.