Explicitly test "not" condition e.g. if (null === $grantedRight).  Also note space between "if" and opening parenthesis