My personal opinion is I wouldn't take candy off a desk if no one is there. I just would rather ask. If I walked by a person's desk and saw candy, and they weren't there, being the person that I am, I'd just not take any.

now, if the person was there and I was visiting them or the company they are with, then I'd politely ask.

But just walking by her desk, on their way to pay their water bill, and she's not there... That is just not polite to me.