If you read the Administration and Enforcement of the California Health and Safety Code - HSC; the codes can be enforced by the Local Jurisdiction or County Health Department, in CA
There are Hundreds of non-building Codes and Regulations, requiring local Enforcement. By the Building or Health departments.
In CA, Counties are an extension of the State government, and general law cities are an extension of the county government.
Charter cities are a little different.
https://www.google.com/search?q=Health+and+Safety+Code+-+HSC+"enforcement"&sa=X&ved=2ahUKEwi0_5q8j7zjAhWrr1QKHSS4A0UQ5t4CMAN6BAgCEAc&biw=1536&bih=715&dpr=1.25