A method for operating a system for controlling access to an access-restricted area in a building or a compound, wherein the system comprises a transmitter and receiver unit for the radio communication with mobile electronic devices carried along by users, a storage unit (26, 28), a processing unit and a code processing unit (16, 22), and wherein the method comprises the steps of: receiving a first identifier (Ki) of a first mobile electronic device of a first user by means of the transmitter and receiver unit when the first mobile electronic device is located in a public area, from which the first user can request access to the access-restricted area; storing the received first identifier (Ki) in the storage unit (26, 28), wherein a first dataset (DSi) is created for the first identifier (Ki) and assigned to the first user present in the public area, wherein a plurality of datasets can be stored in the storage unit (26, 28), and wherein each dataset is assigned to a user present in the public area; storing a first password (Ci) in the first dataset (DSi) such that the first code word (Ci) is assigned to the first identifier (Ki); determining if the first identifier (Ki) is assigned to a user profile in a database by means of the processor unit in order to authenticate the first user as having access authorization in the event of such an assignment; acquiring a password (Cd) presented by the first user by means of the code processing unit (16, 22) when the first user requests access to the access-restricted area; and determining if the acquired password (Cd) matches the first password (Ci) stored in the first dataset (DSi) of the storage unit (26, 28) by means of the processor unit, wherein the first user is recognized as an access-requesting user in the event of a match. receiving a first identifier (Ki) of a first mobile electronic device of a first user by means of the transmitter and receiver unit when the first mobile electronic device is located in a public area, from which the first user can request access to the access-restricted area; storing the received first identifier (Ki) in the storage unit (26, 28), wherein a first dataset (DSi) is created for the first identifier (Ki) and assigned to the first user present in the public area, wherein a plurality of datasets can be stored in the storage unit (26, 28), and wherein each dataset is assigned to a user present in the public area; storing a first password (Ci) in the first dataset (DSi) such that the first code word (Ci) is assigned to the first identifier (Ki); determining if the first identifier (Ki) is assigned to a user profile in a database by means of the processor unit in order to authenticate the first user as having access authorization in the event of such an assignment; acquiring a password (Cd) presented by the first user by means of the code processing unit (16, 22) when the first user requests access to the access-restricted area; and determining if the acquired password (Cd) matches the first password (Ci) stored in the first dataset (DSi) of the storage unit (26, 28) by means of the processor unit, wherein the first user is recognized as an access-requesting user in the event of a match.