The right to collect rates or compensation for the use of water supplied to any county, city, or town, or water district, or the inhabitants thereof, is a franchise, and can not be exercised except by authority of and in the manner prescribed by law.