Nobody but guards on duty were allowed inside the building itself and outsiders were blank from the compound altogether.
The only words I can think of for blank are barred or forbidden to enter both of which sound a little too formal. Any advice?
'prevented' - "They were prevented from entering the building" (a little bit formal)
'kept' - "They were kept from entering the building" (very straightforward, not formal, not particularly informal, very plain though)
'stopped from entering' - also very plain. (implies though a little bit more active intervention maybe as opposed to just say a fence)