The building department of every city or city and county shall enforce the provisions of this part within such city or city and county. “Building department” or “department” means the department, bureau, or officer charged with the enforcement of laws or ordinances regulating the erection, construction or alteration of buildings.