Simplified the logic in allow_access() and tweaked some whitespace.