It is not just a restriction on the powers of the central government. On the other hand, the citizens of a state can adopt a constitution that might restrict the exercise of such rights by delegating the power to do so to the state government. The legal basis for a government not infringing on the right to keep and bear arms is not constitutional provisions like the Second Amendment, but that the power to do so is not one of the enumerated powers delegated to the government, whether Union or State. That delegation must be explicit as pertains to arms. They can't be regulated on the basis of general powers to tax or to regulate commerce.
Arms have a special status under constitutional law.
Some State constitutions may delegate such powers to the State government. The U.S. Constitution does not delegate such powers to the Union government. No powers are delegated to government by the preamble to a constitution, which is only a statement of purpose, only by provisions in the body of the document and its amendments. The legal basis on which the states can regulate arms is in those situations in which they conflict with property rights. It is a fundamental principal in law that the owners or managers of real property have the power to regulate who may enter their premises, and to set conditions upon their entry.