New York’s legislature approved a sweeping overhaul Friday of the state’s handgun licensing rules, seeking to preserve some limits on firearms after the Supreme Court ruled that most people have a right to carry a handgun for personal protection.

The bill, which Gov. Kathy Hochul said she intended to sign, is almost sure to draw more legal challenges from gun-rights advocates who say the state is still putting too many restrictions on who can get a gun and where they can carry it.

Also read: Joe Biden signs landmark gun measure, says ‘lives will be saved’

Backers said the new law strikes the right balance between complying with the Supreme Court’s ruling and keeping weapons out of the hands of people likely to use them recklessly or with criminal intent.

Among other things, the state’s new rules will require people applying for a handgun license to turn over a list of their social media accounts so officials could verify their “character and conduct.”

Under the law, applicants would have to show they have “the essential character, temperament and judgment necessary to be entrusted with a weapon and to use it only in a manner that does not endanger oneself and others.”

As part of that assessment of good character, applicants have to turn over a list of any social media accounts they have had in the past three years “to confirm the information regarding the applicant’s character and conduct.”

Also read: One month after Uvalde shooting, gun control has a bittersweet day in US

“Sometimes, they’re telegraphing their intent to cause harm to others,” Gov. Kathy Hochul, a Democrat, said at a news conference.

Gun rights advocates and Republican leaders were incensed, saying the measure intrudes on constitutional rights.

“What is being proposed in New York is a violation of Second Amendment rights, but they are also asking you to sign away your privacy rights for social media accounts, signing away your First Amendment rights,” said Mark Liva, the National Shooting Sports Foundation’s managing director of public affairs. State Republican Chair Nick Langworthy said “New Yorkers’ constitutional freedoms were just trampled on.”

The bill didn’t specify whether applicants would be required to provide licensing officers with access to private social media accounts not visible to the general public.

People applying for a license to carry a handgun would also have to provide four character references, take 16 hours of firearms safety training plus two hours of practice at a range, undergo periodic background checks and turn over the contact information of their spouse, domestic partner or any other adults living in their household.

Also read: US Supreme Court strikes down New York gun law: How it changes things

Aaron Dorr, the executive director of the New York State Firearms Association, called the measure “the kind of bill that the Gestapo would be proud of” or “you’d see in Communist China.”

“This will never survive a court challenge,” he said.

Hochul’s chief lawyer, Elizabeth Fine, insisted the state was setting out “a very clear set of eligibility criteria” and noted that the legislation includes an appeals process for applicants who may feel a reviewer acted inappropriately.

The state Senate approved the measure Friday during a special legislative session called to address the state’s gun laws. The Assembly was expected to consider the measure later in the day.

The Supreme Court ruling struck down a previous rule requiring people to demonstrate an unusual threat to their safety to get a license to carry a handgun outside their homes. That restriction generally limited the licenses to people who had worked in law enforcement or had another special need that went beyond routine public safety concerns.

Under the new system, the state wouldn’t authorize permits for people with criminal convictions within the past five years for driving while intoxicated, menacing or third-degree assault.

Also read: US Senate passes bipartisan gun control bill: What comes next?

People also wouldn’t be allowed to carry firearms at a long list of “sensitive places,” including New York City’s tourist-packed Times Square.

That list also includes schools, universities, government buildings, places where people have gathered for public protests, health care facilities, places of worship, libraries, public playgrounds and parks, day care centers, summer camps, addiction and mental health centers, shelters, public transit, bars, theaters, stadiums, museums, polling places and casinos.

New York would also bar people from bringing guns into any business or workplace unless the owners put up signs saying guns are welcome. People who bring guns into places without such signs could be prosecuted on felony charges.

That’s a reverse approach from many other states where businesses that want to keep guns out are usually required to post signs indicating weapons aren’t allowed.

Gun advocates said the bill infringes on rights upheld by the Supreme Court.

Also read: ‘Disappointed’ Joe Biden blasts SCOTUS decision to strike down NY gun law

“Now we’re going to let the pizzeria owner decide whether or not I can express my constitutional right,” said Sen. Andrew Lanza, a Staten Island Republican. “This is a disgrace. See you in the courts. You all know this is unconstitutional. You all know this is just a ruse. Another attempt to say to the people of the state of New York: ‘We don’t trust you.’”

The bill would also fix a recently passed law that barred sales of some types of bullet-resistant vests to the general public, but inadvertently left out many types of body armor, including the type worn by a gunman who killed 10 Black people in a racist attack on a Buffalo supermarket.

If passed, the bill would go to Hochul’s desk for her expected signature, then take effect Sept. 1.