A court ruling has at least temporarily put a roadblock in front of an investigation of alleged gangs within the Los Angeles County Sheriff’s Department that seeks to have deputies answer questions and reveal any tattoos.

The preliminary injunction was issued this week after hearings on a lawsuit filed by the Association for Los Angeles Deputy Sheriffs, the union that represents deputies, the Los Angeles Times reported Tuesday.

Allegations of LA deputies forming gangs date back decades. The long-running investigation is being conducted by the county Office of Inspector General and is supported by Sheriff Robert Luna, who ordered deputies to cooperate.

The lawsuit asserts that requiring deputies to show tattoos and be interviewed would violate the Fourth Amendment’s ban on unreasonable searches, the Fifth Amendment’s protections against self-incrimination, and state labor law.

Superior Court Judge James Chalfant’s ruling found the labor law arguments most compelling, saying the county is statutorily obligated to bargain with the union before putting in place significant changes such as the requirement to show tattoos.

“The county will face little to no harm from a preliminary injunctive relief because the tattoos are permanent and will be available for inspection after a trial on the merits,” Chalfant wrote.

Inspector General Max Huntsman said he was disappointed but expects the county to appeal the ruling.