public
Description: Merb plugin that provides an allow/deny DSL for controlling access
Homepage:
Clone URL: git://github.com/ivey/merb_doorman.git
ivey (author)
Wed Jun 18 17:40:12 -0700 2008
commit  bf5f6309c001623a97c5ecd5879eb234426f6921
tree    d7ded5451c16f89eec1edfdc905b8db568086997
parent  29c6e70223ac3dc95555470950236490204646a7
name age message
file LICENSE Sat Jun 14 12:02:35 -0700 2008 Skeleton generated, README updated [ivey]
file README Wed Jun 18 17:40:12 -0700 2008 basically working, but untested [ivey]
file Rakefile Sat Jun 14 12:02:35 -0700 2008 Skeleton generated, README updated [ivey]
file TODO Sat Jun 14 12:02:35 -0700 2008 Skeleton generated, README updated [ivey]
directory lib/ Wed Jun 18 17:40:12 -0700 2008 basically working, but untested [ivey]
directory spec/ Wed Jun 18 17:40:12 -0700 2008 basically working, but untested [ivey]
README
merb_doorman
============

*** Want to contribute?  Some of the code isn't spec'd yet. ***


Merb plugin that provides an allow/deny DSL for controlling access


# mostly open:
# there is an implicit "allow :all" as the last rule
# rules continue to match until an allow is found, or we run out
# of rules

deny :host => "209.34.*"
deny :user => "bill"       # calls current_user.login, but this is configurable
deny :user_agent => /MSIE/
deny {|c| c.params["arbitrary"] == "expressions"}


# mostly closed:
deny :all                           # removes implicit final allow :all
allow :host => "*.example.com"
allow :time => "8am-5pm" # not implemented yet

# store a block for repeated usage
Merb::Access.add_block :admin, {|c| c.current_user.admin?}

allow :admin