2 Chronicles 23:3-8

3 All the assembly made a covenant with the king in the house of God. He said to them, Behold, the king's son shall reign, as Yahweh has spoken concerning the sons of David.  4 This is the thing that you shall do: a third part of you, who come in on the Sabbath, of the priests and of the Levites, shall be porters of the thresholds;  5 and a third part shall be at the king's house; and a third part at the gate of the foundation: and all the people shall be in the courts of the house of Yahweh.  6 But let none come into the house of Yahweh, save the priests, and those who minister of the Levites; they shall come in, for they are holy: but all the people shall keep the charge of Yahweh.  7 The Levites shall compass the king round about, every man with his weapons in his hand; and whoever comes into the house, let him be slain: and be you with the king when he comes in, and when he goes out.  8 So the Levites and all Judah did according to all that Jehoiada the priest commanded: and they took every man his men, those who were to come in on the Sabbath; with those who were to go out on the Sabbath; for Jehoiada the priest didn't dismiss the shift.