If a landlord rents a unit that is unpermitted the following problems may occur.

1: Code/Zoning enforcement may require you to convert the unit to the originally permitted use, and pull any required permits to make this
    change. Failure to do so may result in fines being imposed and eventually, criminal prosecution may result if the landlord does not comply

2: Any tenants who are/were living in the unpermitted unit may sue you for a rent refund for their entire tenancy arguing the rental agreement
    was illegal and therefore void. The landlord can then try to argue "quantum merit"  which means tenant benefited from the property and 
     therefore should pay a reasonable amount for the time they were in. In addition, the tenant may sue for moving expenses and other legal causes of action may be available

3: If you try to evict a tenant living an unpermitted unit for non-payment of rent or other problems the tenant may use the defense as stated in 2 above 

Legal advice should be obtained  first from an attorney re above

See the 2018 link from San Diego County of new rules for "Granny Flats" at LINK