As far as im aware the intended gate must be insight and free of aircraft and that is when the doors can be disarmed. This is at the discretion of the Pilots. Seatbelt sign can not be switched off until doors have been confirmed Disarmed and crosschecked.
This is the procedure for my company.