The Prophet ﷺ said, "You have been given permission to go out for your needs."Hisham explained that this referred to relieving oneself.
عن النبي ﷺ قال: قد أذن أن تخرجن في حاجتكن. قال هشام: يعني البراز.
Bukhari narrated it in the chapter on wudu (147), in this abbreviated form, from Zakariya, who said, Abu Usama told us, from Hisham bin Urwa, from his father, from Ayesha, and she then related the hadith. He also narrated it in the chapter on tafsir (4795) in full detail, with the same chain mentioned above, Zakariya here being the son of Yahya. In it, Ayesha said, Sawda went out after the veil had been prescribed, to attend to a need of hers. She was a large woman, not one who could go unnoticed by those who knew her. Umar bin Khattab saw her and said, "Sawda! By Allah, you cannot hide from us, so consider how you go out." She said, I turned back, while the Messenger of Allah ﷺ was in my house, eating his supper with a bone in his hand. I came in and said, "Messenger of Allah, I went out for a need of mine, and Umar said such and such to me." She said, Then Allah sent revelation to him, and afterward it was lifted from him, and the bone was still in his hand, he had not even set it down. He said, "You have been given permission to go out to attend to your needs."Muslim also narrated it in the chapter on greetings (17/2170), from Abu Bakr bin Abu Shayba and Abu Kurayb, who both said, Abu Usama told us the same hadith, and in it, it says, "She was a large woman who stood out above other women in stature." The meaning of "tafrau" is "to stand out," as in "faraa al-qawm," meaning they rose above them.Al-irq (the bone) refers to a bone that still has some meat remaining on it.The apparent meaning of Hisham's narration conflicts with the narration of Ibn Shihab, for in Hisham's narration the incident took place after the revelation of the verse on veiling, while in Ibn Shihab's narration it took place before the revelation of that verse. The answer may be that the incident occurred twice, for two different purposes, and Urwa narrated both accounts in two separate sittings, so each of Hisham and Ibn Shihab related what he had heard from him.As for his saying ﷺ, "You have been given permission to go out to attend to your needs," this means that the building of latrines within houses had not yet been made obligatory to the point of preventing women from going out, since going out to relieve oneself does not require permission. But once latrines were built within houses, women were prevented from going out except for genuine need. This is shown by the hadith of Abdullah bin Umar, "I climbed up onto the roof of Hafsa's house for some need of mine, and I saw the Messenger of Allah ﷺ relieving himself with his back to the qibla and facing Syria," which is evidence for the building of latrines within houses.