The Messenger of Allah ﷺ said, "When the wife of one of you asks his permission to go to the mosque, he must not prevent her."The wife of Umar bin Khattab used to pray in the mosque, and Umar said to her, "You know that I do not like this."She replied, "By Allah, I will not stop until you forbid me."He said, "I will not forbid you."Umar was stabbed while she was in the mosque.
حدثنا عبد الأعلى عن معمر عن الزهري عن سالم
قال رسول الله ﷺ إذا استأذنت أحدكم امرأته أن تأتي المسجد فلا يمنعها قال وكانت امرأة عمر بن الخطاب رضي الله عنه تصلي في المسجد فقال لها إنك لتعلمين ما أحب فقالت والله لا أنتهي حتى تنهاني قال فطعن عمر وإنها لفي المسجد
Its isnad is sahih. Bukhari related it, 2:291, through the route of Yazid bin Zuray, from Maamar, from Zuhri, and 9:295 through the route of Sufyan, from Zuhri, but he only related the marfu portion of it, not mentioning the story of Umar's wife. Hafiz pointed out in Fath al-Bari, at the first location, this addition found in Ahmad. Muslim also related it, abridged, 1:219, through the route of Sufyan, from Zuhri. Something similar in meaning has already passed with a disconnected isnad in the Musnad of Umar, 283.