The word forbid is not used very much these days, but allow uses the same structure, so I will explain using examples of allow.
Generally, allow takes two objects. Here is the clearest form:
She allows her children an hour of computer games before bedtime
The first object is the beneficiary her children and the second object is the benefit an hour of computer games before bedtime.
We can change the benefit to a to-verb:
She allows her children to play computer games before bedtime
We can negate it in one of two ways, with different meanings
She does not allow her children to play computer games
She allows her children to not play computer games
The first means that she never allows the beneficiaries enjoy a benefit. The second means that she does not force the beneficiaries to enjoy a benefit.
We can also use a gerund in place of a to-infinitive: generally the beneficiary is omitted, and passive mood is often used:
The company does not allow smoking on the premises.
smoking is not allowed on the premises.
The second sentence is passive voice, and so the subject (the company) is omitted , the benefit appears as the patient, and the beneficiary is omitted. The same sentence can also be written with the beneficiary appearing as the patient and the benefit as a to-infinitive but not a gerund:
people are not allowed to smoke on the premises.