Isn't that the way it's always worked? A friend who works at a university told me how male professors always leave the door open when they are talking with female students in their offices. They can easily ruin your life... just like that.
The other option is to have glass walls for offices instead of opaque ones, but that requires having some foresight in building architecture.
But an open door can protect both parties.