Add allow_if option for more flexible acess control

Need to fix a typo here.