Check if relation is in whitelist

The relationsToArray function should check if the relation is within the whitelist, if a whitelist exists.