DENVER (AP) — Denver has approved a first-in-the-nation law allowing people to use marijuana in bars, restaurants and other public spaces, such as art galleries or yoga studios.

The catch: those places would have to seek neighbors’ approval first, and patrons wouldn’t be allowed to smoke inside.

Denver voters approved Proposition 300 as eight other states legalized marijuana for medical or recreational purposes last week. The Denver vote was so close that it took an entire week for supporters to claim victory and opponents to concede.

“It’s the sensible thing to do,” said Emmett Reistroffer, a Denver marijuana consultant and campaign manager for the measure. “This is about personal responsibility and respecting adults who want to have a place to enjoy cannabis.”

The city measure takes effect immediately, but it has a lot of caveats.

First, interested bars and restaurants would have to show they have neighborhood support before getting a license to allow marijuana use. Patrons would have to bring their own cannabis, to comply with state law banning the sale of both marijuana and food or drink.

Patrons at participating bars could consume cannabis inside as long as it isn’t smoked, with the possibility of outside smoking areas. Supporters of the measure had no guess how many establishments would apply for permits, or how long it would take for them to demonstrate community acceptance and receive permits. In other words, it could take many months before Denver sees any Amsterdam-style coffeeshops.

RELATED STORY

America’s New Cannabis Legalization Map Is Amazing

The measure sunsets in 2020, unless city officials renew the licenses or voters make the pot-in-bars measure permanent.

Colorado law neither currently allows nor bans public marijuana use. The result is a hodgepodge of local ordinances related to marijuana clubs. Denver is the first city to allow bars and restaurants to permit marijuana use, though the state Legislature is expected to consider a bill next year to clarify that communities can allow on-site consumption if they wish.

Alaska is the only marijuana state that allows on-site consumption at dispensaries. But Alaska doesn’t allow use in bars or restaurants, and that state is still working on rules for how those cannabis shops’ “tasting rooms” would operate.

Opponents of the Denver measure predicted neighborhoods would resist bars, restaurants and other venues seeking cannabis licenses. They warned the measure won’t properly protect the public from stoned patrons leaving a bar that allows smoking and drinking at the same time.

“How can these businesses possibly monitor patrons for marijuana intoxication?” opponent Rachel O’Bryan said in a statement Tuesday.

RELATED STORY

Where Can I Smoke Legally in a Legal State?

The measure would require any interested bar or restaurant to specially train staff in marijuana use and submit an “operations plan” to show how it would prevent marijuana use by underage patrons. Applicants must also specify “strategies and procedures for identifying and responding to the potential over-intoxication of consumers.”

Mason Tvert, spokesman for the national Marijuana Policy Project and a Denver proponent of the consumption law, said the measure would reduce instances of tourists smoking on sidewalks and in parks because they have nowhere private to consume. A Denver billboard promoting the measure featured a large arrow pointing to a sidewalk below, telling voters that without a provision for social pot use, folks will keep smoking pot in plain view.

“We are setting up a system that is still more restrictive than what we see with alcohol consumption,” Tvert said.