When the right to mine is in any case separate from the ownership or right of occupancy to the surface, the owner or rightful occupant of the surface may demand satisfactory security from the miner, and if it be refused, may enjoin such miner from working until such security is given.
SDCL 45-4-13