A mood is a state of mind. You can have a bad mood or a good mood. This boss was in a mood to be a little naughty.
When you get in a mood all of a sudden, we say that it "strikes."
e.g. All of a sudden, the mood struck and I weeded the garden.
LOL. No. That was Moira's example.
In your text the boss simply had a sudden impulse, and acted on it.