Oh, I understand your original question now. I agree, renaming $allowed to $alreadySet (or similar) would make a better sense.