A city ordinance that bars firearms in public buildings and parks is being challenged by gun rights advocates.