The Weimar legislature passed a law in 1919 that effectively banned all private firearm possession, leading the government to confiscate guns already in circulation.
That didn't really work.
So, in 1928, the Reichstag relaxed the regulation a bit, but put in place a strict registration regime that required citizens to acquire separate permits to own guns, sell them or carry them.
That, interestingly, worked better, mainly, because the police now really
looked after it.
The NSDAP law of 1938 completely deregulated the acquisition and transfer of rifles and shotguns, as well as of ammunition. A lot of categories of people, including Nazi party members, were exempted from gun ownership regulations altogether, while the legal age of purchase was lowered from 20 to 18, and permit lengths were extended from one year to three years.
The law did prohibit Jews and other persecuted classes from owning guns.