Yes, there’s a key, either literally, or a keycard.
Depending on the elevator manufacturer and how it’s programmed, you may be able to have the elevator stop at the private floor and the doors just won’t open… or, the elevator can refuse to go to the floor altogether.
Source: I work in automation, and one of my workplace’s elevators has a keycard lock for one of the floors because it opens directly into a restricted area.
Latest Answers