Depends on the landlord, apartment type, and area. But apartment is the way to go. My apartment was booked on homelydays, I booked in Gulez area of Marrakech but not new build apartment because I didn't want to be paying security etc, the owner was a Moroccan lady. She picked me up with who, I at the time , thought, was her daughter, not great looking but ok n dressed in white jeans . Girl got out the car greeted me with an innocent kiss on cheeks, but remember its Morocco so did seem strange for civi in front of mum. Got into car drove to the apartment, the landlady showed me everything and girl just stood around, then the lady said in French " you know in Marrakech there are lots of prostitutes, some are thieves of opportunity, if you bring any back make sure your things are hidden or I can take anything important for you n give back before you leave " I was thinking thanks for the heads up, but words to the effect of "I didn't know this about Marrakech , and it's not my kinda thing". It was then that I figured that the girl with her was probably not her daughter! But I thought if I suddenly change tone I'll look silly n naive.
But yeah, its not 100%, some landlords might be against it n live right next door, just like if you have concierge some might say nothing and some will expect something others might call police cos they can afford it or against their sense of morality.