The perp had security guard weapons clearance. So regardless of laws, he would have had access to weapons and he had thorough background check.
Which homeland security and the ATF gave to a know person that the FBI had on their radar. Really think that one through.