Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

ivey/merb_doorman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages