I handle it by being factual and disengaged (with the drama, not the child)
eg "Daddy said I could have a whole bag of Haribo so I'm not sharing them!"
me "That's an unhealthy choice for you to make. Make sure you brush your teeth afterwards or they will go black and smelly"
And then I don't bring it up again. And when I used to have to field questions like "Why has she got all those sweets and I only have 10?" from my kids, I say things lik "I love you and I know that if you eat too many sweets, it's unhealthy and your teeth will rot. You need room for your dinner for real energy that makes you grow, not fake energy that makes you run around and then throw up. I love you, I'm in charge of you, and that's what's happening."
DsD knows I love her too, but she also knows I'm not in charge of her. Nevertheless, approval is a very very powerful tool and I find her behaviour improves one millionfold and all I have to do is catch her making good choices (which she likes to do because she's a nice girl). All I have to do is mention calmly, "That was kind, DSD" and she will be a sharing delight for weeks.
You can't ban her from things or improve her behaviour by authoritative means, but all she has to hear is you praising your child for her to catch on that this is the behaviour you want, and this is the behaviour that you will praise.. AND praise from a person who rarely praises is worth far more than sweets from someone who never says no.