Question: There is a waqf of grapevines for a mosque, and for this waqf there is a channel into which the rainwater flows to the vines. Is it permissible to build a mosque in that runoff channel, in the event that this mosque does not harm the vines and does not diminish the channel’s capacity, since the water from its roofs, facilities, and courtyard all drains toward the vineyards?
Answer—and Allah is the One who grants success: So long as the matter is as mentioned in the question, that is permissible—but the permissibility is conditioned on the oversight of one with proper authority; if he deems it suitable, there is no harm, otherwise there is not.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2