A district may commence, maintain, intervene in, defend, and compromise actions and proceedings to prevent interference with or diminution of the natural flow of any stream or streams or unnavigable river, or rivers, including the natural subterranean supply of water therefrom, which may be used or useful for any purpose of the district, or a common benefit to the lands within the district or its inhabitants; and may commence, maintain, and defend actions and proceedings to prevent any such interference with such waters as may endanger the inhabitants or lands of the district.