When she was a baby and toddler this wasn't an issue, except that I needed to keep the door open to hear what she might be getting up to as I got in and out quickly. As she got older and more independent it sometimes became necessary to let her get in to use the potty while I was showering, etc.
But it just seemed nuts to me that she strolled right in the other day while I was finishing up some personal business and asked me if could help her open a can of dog food. Bless her, she was feeding the dog. But I suddenly realized that there was no reason I needed to leave the door open any more. Certainly a can of dog food could wait. And if she had some other pressing business, it could be accomplished in the other bathroom. We are ever evolving.