DocSavage / rails-authorization-plugin
- Source
- Commits
- Network (25)
- Issues (1)
- Downloads (12)
- Wiki (1)
- Graphs
-
Tree:
7b62677
Kieran Pilkington (author)
Wed Dec 24 02:34:20 -0800 2008
rails-authorization-plugin / init.rb
| a3513ada » | bkatz | 2006-06-29 | 1 | require File.dirname(__FILE__) + '/lib/authorization' | |
| 2 | |||||
| 3 | ActionController::Base.send( :include, Authorization::Base ) | ||||
| 4 | ActionView::Base.send( :include, Authorization::Base::ControllerInstanceMethods ) | ||||
| 5 | |||||
| 6 | # You can perform authorization at varying degrees of complexity. | ||||
| 6dfe9d43 » | grempe | 2008-02-18 | 7 | # Choose a style of authorization below (see README.txt) and the appropriate | |
| a3513ada » | bkatz | 2006-06-29 | 8 | # mixin will be used for your app. | |
| 9 | |||||
| 10 | # When used with the auth_test app, we define this in config/environment.rb | ||||
| 11 | # AUTHORIZATION_MIXIN = "hardwired" | ||||
| 8646a6e5 » | bkatz | 2006-06-29 | 12 | if not Object.constants.include? "AUTHORIZATION_MIXIN" | |
| a3513ada » | bkatz | 2006-06-29 | 13 | AUTHORIZATION_MIXIN = "object roles" | |
| 14 | end | ||||
| 15 | |||||
| 16 | case AUTHORIZATION_MIXIN | ||||
| 17 | when "hardwired" | ||||
| 0cdfeda1 » | bkatz | 2006-08-20 | 18 | require File.dirname(__FILE__) + '/lib/publishare/hardwired_roles' | |
| a3513ada » | bkatz | 2006-06-29 | 19 | ActiveRecord::Base.send( :include, | |
| 20 | Authorization::HardwiredRoles::UserExtensions, | ||||
| 21 | Authorization::HardwiredRoles::ModelExtensions | ||||
| 22 | ) | ||||
| 23 | when "object roles" | ||||
| 0cdfeda1 » | bkatz | 2006-08-20 | 24 | require File.dirname(__FILE__) + '/lib/publishare/object_roles_table' | |
| a3513ada » | bkatz | 2006-06-29 | 25 | ActiveRecord::Base.send( :include, | |
| 26 | Authorization::ObjectRolesTable::UserExtensions, | ||||
| 0140fd1a » | bkatz | 2006-07-01 | 27 | Authorization::ObjectRolesTable::ModelExtensions | |
| a3513ada » | bkatz | 2006-06-29 | 28 | ) | |
| 29 | end | ||||

