Cal. Gov't Code § 66300.6
(b) Notwithstanding any other law and notwithstanding local density requirements, and except as provided in Section 66300.6.5, an affected city or an affected county shall not approve a development project that will require the demolition of occupied or vacant protected units, or that is located on a site where protected units were demolished in the previous five years, unless all of the following requirements are satisfied:
(1)
(C) This paragraph shall not apply to a project that meets all of the following conditions:
(2)
(3)
(4) The developer agrees to provide both of the following to the existing occupants of any protected units that are lower income households:
(B) A right of first refusal for a comparable unit available in the new housing development, or in any required replacement units associated with a new development that is not a housing development, affordable to the household at an affordable rent or an affordable housing cost. This subparagraph shall not apply to any of the following:
(ii)
(C)
(i) For purposes of complying with subparagraph (B), if one or more single-family homes that qualify as protected units are being replaced in a development project that consists of two or more units, “comparable unit” means either of the following, as applicable: