Every person, firm or corporation, including the City and County of San Francisco, under whose immediate direction or authority, either as principal, contractor, or employer, any portion of any public street, park or way may be made dangerous, must erect and so long as the danger may continue maintain around the portion of such street, park or way so made dangerous, a substantial barrier and cause to be maintained at both ends of such barrier and at such other portions thereof as may be deemed necessary by the Director of Public Works during every night from sunset until daylight, lighted lanterns and flares.
Said barrier shall also be marked, designated or delineated by a reflector or reflectors or other device or devices which shall properly warn persons of said dangerous condition in the event of failure of the lighted lanterns or flares to operate properly, or when the use of said lighted lanterns or flares be prohibited during periods of dimout or blackout required of the general public. The type, character and number of said reflectors or devices shall be designated and approved by the Director of Public Works provided, however, that whenever the City and County of San Francisco or any of its departments or agencies is having work performed under contract the obligation of maintaining barriers, lights, flares, reflectors or other warning devices shall rest upon the contractor and not upon the City and County of San Francisco, its agencies or departments.