“he can’t”? Why not?
Are you surrounded by an invisible force field?
Did you immobilize him with your Spidey webs?
Are you an ethereal projection of an extra-dimensional being?
You’ve done one of two things here: you’ve chosen your words poorly, or you’ve failed to accept reality.
Of course he can assault you. He’s right there in, inside your apartment, unrestrained.
I suspect what you meant is “he shouldn’t” or “he isn’t legally permitted to do so”, both of which are true, but neither of which will stop an assault.
So, if you conduct yourself as tho some part of reality prevents him from assaulting you, when the assault begins you will likely be ill-prepared to deal with it, and will prolly suffer pain and grief.
If you conduct yourself as tho he might assault you, accepting that in reality there is no real external restraint on his actions, maybe you are ready and kick him in the nuts before he can do you serious harm, call the cops, wake the neighbors, etc. There’s no guarantee you’ll come out unscathed, or even win the battle, but at least you’ll be ready and capable of making him pay for his actions. Like I said, most predatory types don’t really like a confrontation; they just like the feeling of power they get with an easy win. Don’t be an easy win.
Interested and perceptive readers will note: what you did there, in laying out the reasoning for your hypothetical response, is exactly what I think may have possibly happened to the blogger in the OP: a failure to accept the reality of her surroundings and/or a poor choice of words at a critical time.
Life is not an easy, happy-go-lucky romp in the park. Well, okay, it sort of is, but there’s always a pack of deranged, hungry jackals chasing you and nipping at your heels, so to speak.
Prepare for the worst; hope the best. If things go wrong, end it now; sort it out later.