As discussed in an earlier installment, men – like women – are required to dress in an appropriate manner. This includes a requirement to limit exposure to the minimum extent necessary when changing or performing one's bodily functions, and ensuring to lock the door when using the restroom.
The Poskim make a point of emphasizing the requirement for parents to educate their children in this regard. Even at a young age, children should not be permitted to walk about unclothed. And, after a child is toilet-trained, the child should be taught to keep the door closed while using the restroom. While it of course might be dangerous to instruct a small child to lock the door – as an adult should when using the restroom – children should be taught to keep the door closed and maintain privacy while changing their clothes and while using the restroom.

