I actually agree with Armani. There's no point in trying to get owners to agree beforehand to you having guests as this simply gets their hackles up and makes them suspicious. You are renting the flat/villa so you actually can have whom you want back or to stay, within the confines of the law, of course - although foreigners are given an awful lot of leeway.
In my view it's best to see what you're going to rent, so before I came to live in Morocco I always tended to ,look for a place on the first day of my arrival. The one time I rented online, the villa (absolutely fabulous, luxurious and well-furnished) was just over the road from a slum and 2 Moroccan friends leaving late at night were threatened and one had his mobile stolen. I shan't make that mistake again.