I'm not sure what era you're going for, so I'll take "peasants" and run with it. ;)
There weren't laws as such against owning weapons in medieval Europe. Cost would have made the purchase of nicer weapons prohibitive for a lot of peasants, certainly. But even the Jews of the 11C Rhineland had access to swords and armor. Skip forward a few centuries, and it was dangerous not to carry a weapon in southern Germany. Not because of bandits, but because everyone carried them--except pacifist Anabaptists. Being an adult male not carrying a weapon got you arrested as a heretic.
Medieval clergy were not supposed to shed blood in violence. But that is a different kind of exception.
only certain classes we allowed to have weapons.
What does that mean?
What about Japan and the East in particular then?