within (one's) rights
Being allowed by the law to do something or behave a certain way. I'm sorry, sir, but he's within his rights to put these signs on his lawn, even if you find them offensive. They were well within their rights to deny entry to the man, who they claimed was intoxicated and unruly.
*within one's rights
acting legally in one's own interest. (*Typically: be ~; act ~.) I know I am within my rights when I make this request. You are not within your rights!
within your ˈrights
having the moral or legal right to do something: They were acting perfectly within their rights when they refused to let you into their house.