Whatever remedies the lessor of any real property has against his immediate lessee for the breach of any agreement in the lease or for recovery of the possession, he has against the assignees of the lessee for any cause of action accruing while they are such assignees, except where the assignment is made by way of security for a loan and is not accompanied by possession of the premises.
SDCL 43-32-20