Every officer to whose charge any jury is committed by any court or magistrate, who negligently or intentionally permits them or any one of them:
(1) To receive any communication from any person;
(2) To make any communication to any person;
(3) To obtain or receive any book or paper; or
(4) To leave the jury room without the leave of such court or magistrate first obtained; is guilty of a Class 2 misdemeanor.