SALT LAKE CITY (AP) — Nearly three years before a gunman walked into a crowded supermarket with an AR-15 style weapon and killed 10 people, the city of Boulder, Colorado, banned assault weapons in hopes of preventing a mass shooting. But just 10 days before Monday’s rampage, the measure was blocked in court after a lawsuit backed by the National Rifle Association. The ruling came under a Colorado law that bars local officials from making their own gun laws. More than 40 states have similar preemption measures. Supporters say they keep gun laws consistent but critics say they stymie officials trying to make communities safer.