Toilet doors are required to have lift-off hinges. This means that if someone gets trapped on the toilet, the door can be easily removed.
They are a type of hinge made up of two parts which allow door removal without the need to open the door. A suitable door latch should allow the door to be lifted upward and away even if it is in a locked position.