I’m making that statement based on the conclusion (perhaps wrong) that the apartment wasn’t paid for.
If it was paid for, and a fair rent, then is was improper.
If it wasn’t paid for, at a fair rent, it would seem to this poster to be illegal.
However I am not legal expert, so that is just my opinion.