They just did it in Germany. They banned anyone from a major non-leftist political party (AfD) from owning a firearm. So the precedent is there.
Germany does not have a constitution.