What is the ruling on praying on the rooftop of a dung heap, bathhouse, or camel resting place?
Chapter on Praying with Impurity and Other Matters
Al-Mughni
Book of Prayer
Primary text
One view is that the ruling is the same as praying within the place itself because the airspace is considered تابع (subordinate) to the ground beneath it, similar to how entering the roof of a house violates an oath not to enter the house. The sounder opinion is that the prohibition is limited only to what the text explicitly covers, and it does not extend to the rooftop, especially if the prohibition is based on specific ritual command (Ta'abbudi) or impurity, which is not conceptually present on the roof.
Supporting text
If a structure (like a vault or projection) is built over a public road, the ruling follows whether the structure is permissible. If it is built over a river used by boats, the ruling is debated between following the road's status or remaining permissible. If a mosque existed before a prohibited area (like a road or camel resting place) developed beneath it, or if a cemetery developed around a mosque, prayer in the mosque remains valid as it did not follow the subsequent development.