Yes, but only through individual due process in a court of law. The fifth amendment reads, "No person shall be deprived ..." We may find a man guilty and take away his fundamental right to liberty by locking him up, but we may not lock up "all those under 18" or "all males".
Also, neither the federal government nor any state government currently recognizes the right to keep and bear arms as a fundamental right. That may change with this ruling.