public
Description: An authorization Rails plugin using a declarative DSL for specifying authorization rules in one place
Homepage:
Clone URL: git://github.com/stffn/declarative_authorization.git
declarative_authorization / authorization_rules.dist.rb
100644 21 lines (18 sloc) 0.583 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
authorization do
  role :guest do
    # add permissions for guests here, e.g.
    #has_permission_on :conferences, :to => :read
  end
  
  # permissions on other roles, such as
  #role :admin do
  # has_permission_on :conferences, :to => :manage
  #end
end
 
privileges do
  # default privilege hierarchies to facilitate RESTful Rails apps
  privilege :manage, :includes => [:create, :read, :update, :delete]
  privilege :read, :includes => [:index, :show]
  privilege :create, :includes => :new
  privilege :update, :includes => :edit
  privilege :delete, :includes => :destroy
end