Isn't that an infringment of cities' rights?
The powers (and lack thereof) of local government in the United States are governed by state constitutions, so it would depend on what the Arizona Constitution has to say on the matter. If this was a matter of dispute I think we would've already heard about it, though; most criticisms from Democrats are about the effects of the policy itself, not its legality. (And legality is a much easier thing to attack, so...)
Well, the idea of "cities' rights" isn't really more or less sensical than the beloved "states' rights" of right-wingers.
The relevant question is which one is more likely to hold up in court.