And by "right", I mean both contexts.
If you have a right to do something, no one needs to give you permission to do it. It may not make other people happy, and may seem "selfish", but as long as you are not attacking, stealing, or trespassing, other people's opinions only matter if you let them.
Then, if something is the right thing to do, you should do it because to do otherwise is probably not quite as good a choice; being either wrong or neutral.
Sometimes things aren't right, but are understandable; human nature, biology, and physiology being what it is. These are the things I sometimes categorize as "justified". This category is wishy-washy and depends a lot on personal values and opinions, created over a lifetime of experiences.
Then there are things that you do, or avoid doing, because you are considerate of someone else's preferences. You are being nice. You may have a right to do something, but you don't do it to be "nice". Or, something may be "justified" but you are able to get past your baser instincts and be "nice". Or you may have no obligation to do something at all, but you go out of your way to be nice and do it anyway.
"Nice" is where I wish we could all exist at all times.