Note that the white list example is not really scalable for big projects since you at some points will run out of account space. 
A better approach will be to use external PDAs that store the whitelist instead. 