Instead of having a door knob you can instead use a button with a handle and an off switch on the inside to restrict access. Why not? I made this out of a solenoid I had laying around since I was thirteen. The solenoid (while in the door) stays normally in the locked position. It came with a ring around the slug (something I haven’t seen on any other solenoids) so I stretched a spring around it to keep the slug extended until current is run through the solenoid and pulls it shut.
I sketched up the schematic in the first photo above and put it together using all scrap components I had in my parts drawers; all of which are clearly described in the schematic courtesy of my younger self. I carved out my door to accomodate the solenoid and made a strike plate out of hardboard to control the reach of the slug.
There’s a momentary switch for activating the solenoid on each side of the door and a handle for leverage opening and closing. A rocker switch kills power to the relay and “locks” the door. The door turned out to be a lot of fun to use and did the job just great. It has no serious advantage over a normal doorknob other than the enjoyment of using it and the $13 savings.