Many towns have been quick to realize that they have the power to dictate if and where dispensaries can open. That has left local officials — from planning and zoning board members to elected mayors and trustees — to grapple with the best way to regulate the marijuana industry in their town.