I would think that as long as its a visitor staying for a period and that you let the landlord know ahead of time , that there would be no problems.
I had an apartment in my name only and later my ex joined me ( I did not add him to the lease).
When of course things escalated with his bad behavior resumed and his not working no paying anything it became clear it was time for him to leave.
He refused and behind my back thought that if he paid part of the rent that he would be considered on the lease, but not so.
My signed permission was needed and thus after he realized that I wasn’t going to add him
and much pains , he left after his newly formed friendship with another man, he got looked
after at his place , and it was that man’s problem then on.
Sometimes its a good thing to NOT add anyone to your lease as If I had the management
would not have any legal recourse to evict him.
You can avoid all of this if you consider what would happen is you have a falling out with your friend?
Avoid all this drama by just having him as a visitor for a time period like a visiting relative for
a few months .