We used to have those. We called them outhouses.
In that every sidewalk in San Francisco is a toilet I don’t see where the law is needed.