(1) Any person who goes armed with a firearm in any building owned or leased by the state or any political subdivision of the state is guilty of a Class A misdemeanor.
(2) This section does not apply to any of the following:
(a) Peace officers or armed forces or military personnel who go armed in the line of duty or to any person duly authorized by the chief of police of any city, village or town, the chief of the capitol police, or the sheriff of any county to possess a firearm in any building under sub. (1). Notwithstanding s. 939.22 (22), for purposes of this paragraph, peace officer does not include a commission warden who is not a state-certified commission warden.