Accordingly, the stronger view is that prayer is valid on all these roofs except the roof of a graveyard and the roof of a bathhouse. As for the graveyard, construction over a graveyard is like the graveyard itself, in that it may lead to the worship of graves. This is why building over graves has been prohibited. As for the roof of a bathhouse, it falls under the designation of a bathhouse itself. However, this matter has already been discussed (1), and I remain uncertain about it.
Prayer Is Valid Facing Them
His statement, “Prayer is valid facing them,” means that prayer is valid when these places are in one’s direction of prayer. Thus, if there is a bathhouse, a camel enclosure, usurped property, or a grave in front of a person praying, his prayer is valid. This is what the author’s words imply.
They nevertheless said that it is disliked when there is no barrier, even one such as the rear support of a saddle (2), which measures half a metre by half a metre.
The evidence for its validity is the general purport of the Messenger’s saying, may Allah’s peace and blessings be upon him: