You may have 3 techniques.
Sims 2 lock doors mod.
When a sim enters the bathroom the door locks behind them and no one else not even npcs can get in.
Is there a way to get around this b c in sims 2 this wasn t an issue.
You could lock doors without expansions or mods.
Only pull up the partitions i i on the door.
Doors and other hacks that control where individual sims or types of sims can go.
This little tuning mod adds a simpicker to the unlock door pie menu.
Click on links to download or go to specific page.
Sims 2 access control.
Maxis modular stairs passage fix this mod enables sims to pass directly through under all maxis modular stairs just like base game holy smoke stairs.
When the sim comes out the door is left unlocked ready for the next person.
Build buy mode mods.
You could the two lock the door so only that particular sim can enter so.
On residential lots with the simpicker you can choose up to 20 sims including sims who are not in the household to unlock lock the door for.
I have my front door locked to everyone except household and i ve hired a maid to clean my house.
Unfortunately the maid just waits outside my house until i have to manually dismiss her.