So this question stems from an article on cbc, describing how it can happen that an AirBnB host rents an apartment in a block where short term rentals are forbidden. The article states that in some cases the guest learns this too late, and is in effect told that if staff discover the fact they are an AirBnB guest, the staff will stop them from staying at the apartment, or prevent entry.
What I'm wondering is, can staff legally do this in many countries? Because any lease (or other legal agreement) that the staff would rely on, doesn't bind the guest (or sublessee?), who had not agreed to it. It's a bit like privity of contract - the usual inability to assert a term of a contract against a person who isn't a party to that contract.
(Of course there may be other grounds which can be asserted, and law is different between countries, especially land law, but still, I'm left wondering.)
Suppose for the sake of making this straightforward, we model this kind of situation with a simple and scrupulously law-abiding landlord and guests, who are each determined and have a fixed intent, but otherwise professional and cool-headed:
The landlord absolutely doesn't want AirBnB guests, but if one is discovered, they won't forcibly kick the guests out unless the law would back them in doing so, for fear of litigation/conflict. If they can't legally remove such guests, they would take action against the renter/apartment owner instead, later, but by then the guests will have left. Similarly they would lock the guests out or block the doorway physically, if they can, but not if this puts them at risk of lacking legal basis for doing so, or losing a legal case.
The guests are very well behaved, but determined and desperate to stay (they don't have anywhere else for the short duration). They don't cause any nuisance or damage except perhaps the absolute minimum to gain entry if blocked by the landlord. They persistently tell the landlord it's not their problem and to take up any complaint with the tenant/renter, and walk on by. If locked out or the way is blocked, they will take action to the maximum level that would be supported by local law for a person in their situation, and ignore the landlord's insistent directions that they have to leave or can't come back in the door. If the law doesn't clearly allow the landlord to lock them out or evict them, they would take any action that could be free of criminal consequences within the law if the landlord tried to ban them. They might push the block door open if held shut, call police to gain entry, (gently) push past the landlord in the doorway/corridor, bluntly disobey landlord instructions not to use their keys, or get a local lawyer (or even if permissible by law a locksmith with master keys).
They might even be willing to break a window to get in, on the pragmatic basis that if it's not a crime to break into a place you have a legal right to stay, when locked out by a person who doesn't have such a right, and reason that the renter/tenant wouldn't have any recourse given they'd deceptively let the apartment and created the situation which led to it (hence safe in practice).
The police will attend if asked, but only interfere if there is an actual crime, or an actual correct basis (fear of affray etc). They are likely to support the guest if the landlord cannot show a legal right against the guest (not just the tenant) to prevent entry.
Assuming this kind of simple model for the situation, in which countries would the landlord be able to eject the guest, or prevent them reentering the block, and in which countries couldn't they?
Note - because AirBnB is international and often used for overseas stays, I'm interested in a sense of general view worldwide, rather than just US/UK.