Yes, when the door closes it triggers the deadlatch locking the door. The door can be opened normally from the inside but the PIN code is required from the outside.
There is also a switch on the inside that allows you to temporarily turn off the PIN code if required. This allows access from the outside without the PIN and is called Latch Holdback.
Anthony N