SACRAMENTO — Gov. Jerry Brown vetoed a bill Wednesday that would have allowed co-workers and school personnel to petition a court to temporarily remove guns from someone they believe poses an immediate danger.

AB2888 by Assemblyman Phil Ting, D-San Francisco, would have expanded the list of people who can ask a court for a gun violence restraining order under a 2016 law, a little-known process under which a judge can bar a person from possessing a gun for as long as a year.

The law can now be used only by immediate family members, roommates and law enforcement. Under Ting’s bill, teachers, principals, co-workers and employers would have been able to ask for a gun restraining order for people they feared were a threat to themselves or others.

“All of the persons named in this bill can seek a gun violence restraining order today under existing law by simply working through law enforcement or the immediate family of the concerning individual,” Brown said in his veto message. “I think law enforcement professionals and those closest to a family member are best situated to make these especially consequential decisions.”

Currently, if a judge grants a restraining order, the gun owner is required to surrender his or her firearms for 21 days while awaiting a hearing on whether the order will be extended for a year. During that time, the person is barred from buying firearms or ammunition.

During 2016 and 2017, 189 petitions for gun violence restraining orders were granted in California, state Justice Department figures show. The vast majority of them were requested by law enforcement officers, while 12 were at the urging of family members. In the Bay Area, 29 orders were issued, all at the request of police.

The orders are opposed by gun rights advocates, who complain that the 2016 law allows judges to remove weapons first and ask questions later. They said expanding the law was likely to lead to abuses.

Brown did, however, sign another gun-related bill that sets a minimum training standard for people applying for a concealed weapons permit.

AB2103 by Assemblyman Todd Gloria, D-San Diego, requires applicants to complete at least eight hours of training and a live-fire shooting exercise before they can receive a concealed-carry permit. Those requirements go into effect Jan. 1.

“This bill has always been about common sense,” Gloria said. “This makes our communities safer.”

Melody Gutierrez is a San Francisco Chronicle staff writer. Email: mgutierrez@sfchronicle.com Twitter: @MelodyGutierrez