I remember there's already software for Mac like 10+ years ago that use bluetooth device (headset or mobile phone, etc.) to do that. When the device is not within range (disconnected) that screen will lock immediately. When that devicee is within range again the screen is automatically unlocked. With old bluetooth's receiving range this is pretty nice help for people who keep forgetting to lock their PC when not in use.
I suppose others can make similar application to work with RFID enabled staff cards.