Doorman

Doorman it’s a super simple (aka stupid) white/black list manager.

Doorman acts different depending on the kind of list you’re asking:

If you ask if somenthing could pass based on the whitelist it would let throught only entities present on the whitelist.
If you ask if somenthing could pass based on the blacklist it would let throught everything except for entities present on the blacklist.

You’ll define those list on a yaml file like this:

white: [[email protected], .*@simplelogica.net]

black: [[email protected], .*@comunistasnazis.net]

It allows ruby regular expresions as shown.

Configuration

For Rails projects:

config.gem 'doorman'

Doorman::CONFIG_PATH = "path-to-your-yml"

Example

Doorman::Whitelist.come_in?(‘[email protected]’) # => true Doorman::Whitelist.come_in?(‘[email protected]’) # => true Doorman::Whitelist.come_in?(‘[email protected]’) # => false

Doorman::Blacklist.come_in?(‘[email protected]’) # => true Doorman::Blacklist.come_in?(‘[email protected]’) # => true Doorman::Blacklist.come_in?(‘[email protected]’) # => false Doorman::Blacklist.come_in?(‘[email protected]’) # => false

I think you’ve got the idea.

Copyright © 2009 Diego Fernández, released under the MIT license