Excerpted story:
Rav Kook related the following story one holiday evening in his sukkah. The incident took place in Jaffa, where Rav Kook served as chief rabbi from 1904 to 1914. One Shabbat day, a secular photographer came and disturbed the Sabbath peace in a religious neighborhood. In total disregard for the local religious sensibilities, he set up his tripod and camera in the middle of the street and began taking pictures.This public desecration of the Sabbath deeply angered the local residents. One man who was particularly incensed by the photographer’s insensitivity took a pail of water and thoroughly soaked the Sabbath-desecrater. Naturally, the photographer was indignant. He was so confident in the justice of his cause that he registered a complaint against the water-douser — at the beit din (religious court) of the rabbi of Jaffa, Rav Kook.Rav Kook told the photographer, “I see that you fail to understand the severity of desecrating the Sabbath in public, but you should realize that your action was a serious affront to the community. You entered a neighborhood of Sabbath-observers and offended them deeply.“Of course, the correct course of action for the residents would have been to rebuke you verbally. Perhaps you would have understood the seriousness of your actions and stopped. Had that man consulted with me first, I would have advised him not to throw water on you.“However, he didn’t ask, but reacted spontaneously. You should know that on occasion, such impulsive reactions are justified. When people disregard societal norms and cross accepted boundaries, regardless of the implications for others, it is often the spontaneous reaction that most effectively prevents future abuse.“Such an occasion took place when the Israelites were in the desert and Pinchas responded, not accordingly to the normative Halachah, but as a zealot: “Kena’im pogim bo” (‘Zealots punish them’ — Num. 25:6-8; Sanhedrin 82a). If Pinchas had asked beforehand, he would have been instructed not to kill Zimri. But since his act was done sincerely and served to prevent future violations, his zealous deed was approved after the fact.”
Of course, the context is important; see the whole within!