Where a person, by his will, professes to dispose of something which he has no right to dispose of, the person to whom the thing belongs shall elect either to confirm such disposition or to dissent from it, and, in the latter case, he shall give up any benefits which may have been provided for him by the will. ...