If a public employee acts in good faith, without malice, and under the apparent authority of an enactment that is unconstitutional, invalid or inapplicable, he is not liable for an injury caused thereby except to the extent that he would have been liable had the enactment been constitutional, valid and applicable.
Ca. Gov. Code § 820.6