VICTORIA -- An industrial painter at a Victoria shipyard was refused a national security clearance to work on Canadian warships in part because he is Facebook friends with people tied to drug trafficking, biker gangs and Mexican drug cartels.

Billy Fitzgerald was denied his federal and NATO secret security clearances, barring him from working on Royal Canadian Navy submarines and surface ships at Seaspan Victoria Shipyards.

Fitzgerald, who has worked at the Seaspan yard since 2012, appealed the decision to the Federal Court of Canada, arguing the decision was unfair and unreasonable.

Justice Michael Phelan has dismissed his appeal, upholding the decision of the director of industrial security at Public Services and Procurement Canada.

In 2018, Fitzgerald sought a reliability status security clearance, which would have allowed him to work on military vessels as part of Seaspan's $500-million maintenance contract for Canadian naval frigates and submarines.

Fitzgerald was asked to a face-to-face interview with national security investigators in 2019 to discuss his past, "including finances, associates, personal conduct and travels."

Fitzgerald has 13 criminal convictions dating back to 2000, primarily for drug and alcohol-related offences.

Prior to the interview, Fitzgerald signed a security acknowledgement stating that "in the interest of national security it is the policy of the Canadian government that personnel employed in connection with work, the nature of which is vital to the security of the country, be deemed trustworthy, loyal and reliable."

During the interview, the investigators discussed Fitzgerald's convictions and asked him to "confirm that certain individuals were his friends on Facebook and how he knew these people," according to federal court documents.

The investigators said Fitzgerald's public Facebook page showed he was connected to "high-level drug traffickers" linked to Mexican drug cartels, local cocaine trafficking in Victoria and Calgary, and at least one murder.

Google searches later revealed those same Facebook friends were tied to the Hells Angels and the Norteños Prison Gang, according to the investigators.

Another Facebook connection was found to be "the biggest player in the British Columbia drug trade" who is likely responsible for bringing drugs into Canada from Mexico.

The investigators determined Fitzgerald was dishonest and lacked credibility in the interview, saying their concerns about his criminal history and Facebook connections were not mitigated.

The investigators feared that granting him security clearance would put him in close proximity to military personnel with access to weapons, ammunition and sensitive national security information.

They also worried his online associates and criminal convictions left him open to blackmail and coercion.

Fitzgerald argued in his appeal that the security director did not consider the age of his convictions, the last of which was in 2012, or his maturity since that time. He also argued he did not know he would be questioned about his Facebook profile and friends.

In his decision, Phelan found that national security is paramount to an individual's employment and personal life, and dismissed the judicial review of the case.