It is permissible to offer prayer in the Sacred Mosque in Makkah while the people are passing in front of the praying person and this is one of the special characteristics of the Sacred Mosque.
In this regard, we will cite what Sheikh Sayyed Sabiq states in his well-known book, Fiqh As-Sunnah: “It is permissible to offer prayer in the Sacred Mosque in Makkah while the people, male or female, are passing in front of the worshipper. There is no harm in it, and it is one of the special characteristics of the Sacred Mosque. Kathir Ibn Kathir Ibn Al-Muttalib bin Wida`ah reported from some of his relatives and from his grandfather that he said: “I saw the Prophet (peace and blessings be upon him) offering prayer in the Sacred Mosque in the area adjacent to Bani Sahm while people were passing in front of him but he did not place any sutrah (something that a praying person puts in front of him in order to alert people that they should not pass in front of him while praying) in front of him.” Suffiyan bin `Uyainah said, “There was no sutrah between him and the Ka`bah.” (Reported by Abu Dawud, An-Nasa’i, and Ibn Majah.