I copy pasted $allowed from your solution assuming it has some purpose.
So this should be called sth like $set?