your Distributor rule code:
case "Distributor":
$comparisons[0] = array(TRUE, "".((isset($_SESSION['accessGroupID']))?$_SESSION['accessGroupID']:"") ."", 4, "4");
break;
means allow if $_SESSION['accessGroupID'] <= 4
if the session is not set, it will be < 4. NULL is < 4.
if you want to allow accessGroupID 1,2,3,4 to see the link, you should create a group. Add the values 1,2,3,4 to the group and set the rule up as allow if $_SESSION['accessGroupID'] in group distributor group