Rights-of-way for the construction and maintenance of dams, reservoirs, water plants, ditches, flumes, pipes, tunnels, and canals, within and across the national forests of the United States, are granted to citizens and corporations of the United States for municipal or mining purposes, and for the purposes of the milling and reduction of ores, during the period of their beneficial use, under such rules and regulations as may be prescribed by the Secretary of the Interior, and subject to the laws of the State or Territory in which said forests are respectively situated.