if you need the loo then you have to open the door. If you want food or drink then again open the door. Sometimes gets left open for a minute or two but with someone standing nearby. Have cameras to watch galley area behind door and a light to see if toilet is occupied and not meant to open it if someone is in the loo or galley other than crew. Unlike airport security most of us have brains and if an 80 year old woman has just gone into the loo we would still open the door to leave if we wanted to or open it to get drinks/food.