public
Fork of DocSavage/rails-authorization-plugin
Description: This plugin provides a flexible way to add authorization to Rails.
Homepage: http://www.writertopia.com/developers/authorization
Clone URL: git://github.com/bwyrosdick/rails-authorization-plugin.git
Minor text changes to the generator usage text and 
authorization_example.rb.  Updated about.yml.
grempe (author)
Sun Feb 17 17:54:19 -0800 2008
commit  1f5012543ffae5a792f24fcaacb0bc0e3982cb23
tree    9896d1344a87f94a48f45f48a596e4ddf79a6e97
parent  dcc0e8b025c8ab02273092aaedeb57a58efc0e91
...
1
2
3
4
5
6
7
8
9
 
 
 
 
 
 
 
 
...
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
0
@@ -1,8 +1,8 @@
0
-author: Bill Katz
0
-summary: Adds a flexible mechanism for authorization.
0
-description: Adds a flexible mechanism for authorization. Differs from other authorization systems in the following ways: (1) You can specify roles programmatically with model code or use a mixin to keep roles in a database. (2) The plugin uses a clean language for specifying authorization expressions. (3) Ability to handle roles on instances of a model. (4) Rights are explicitly declared in controller and view code. (5) Different levels of authorization complexity are provided through mixins available with the plugin. If you don’t want to use the database for authorization, you mixin a HardwiredRoles module. If you want full database support for roles on model instances, you mixin the ObjectRolesTable module.
0
-homepage: http://www.writertopia.com/developers/authorization
0
-plugin: http://svn.writertopia.com/svn/plugins/authorization/
0
-license: MIT
0
-version: 1.0rc3
0
-rails_version: 1.0+
0
\ No newline at end of file
0
+author: Bill Katz
0
+summary: Adds a flexible mechanism for authorization.
0
+description: Adds a flexible mechanism for authorization. Differs from other authorization systems in the following ways: (1) You can specify roles programmatically with model code or use a mixin to keep roles in a database. (2) The plugin uses a clean language for specifying authorization expressions. (3) Ability to handle roles on instances of a model. (4) Rights are explicitly declared in controller and view code. (5) Different levels of authorization complexity are provided through mixins available with the plugin. If you don’t want to use the database for authorization, you mixin a HardwiredRoles module. If you want full database support for roles on model instances, you mixin the ObjectRolesTable module.
0
+homepage: http://www.writertopia.com/developers/authorization
0
+plugin: http://svn.writertopia.com/svn/plugins/authorization/
0
+license: MIT
0
+version: 1.0.3
0
+rails_version: 2.0+
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -1,37 +1,38 @@
0
-class MeetingController < ApplicationController
0
- permit "rubyists and wanna_be_rubyists", :except => :public_page
0
-
0
- def public_page
0
- render :text => "We're all in Chicago"
0
- end
0
-
0
- def secret_info
0
- permit "(matz or dhh) and interested in Answers" do
0
- render :text => "The Answer = 42"
0
- end
0
- end
0
-
0
- def find_apprentice
0
- @founder = User.find_by_name('matz')
0
- permit "'inner circle' of :founder" do
0
- if request.post?
0
- apprentice = User.find_by_skillset(params[:uber_hacker])
0
- ruby_community = Group.find_by_name('Ruby')
0
- ruby_community.accepts_role 'yarv_builder', apprentice
0
- end
0
- end
0
- end
0
-
0
- def rails_conf
0
- @meeting = Meeting.find_by_name('RailsConf')
0
- permit "attendees of :meeting or swedish_mensa_supermodels" do
0
- venue = Hotel.find_by_name("Wyndham O'Hare")
0
- current_user.is_traveller_to venue
0
- if permit? "traveller to :venue and not speaker"
0
- Partay.all_night_long
0
- @misdeeds = current_user.is_participant_in_what
0
- end
0
- end
0
- end
0
-end
0
-
0
\ No newline at end of file
0
+class MeetingController < ApplicationController
0
+
0
+ permit "rubyists and wanna_be_rubyists", :except => :public_page
0
+
0
+ def public_page
0
+ render :text => "We're all in Chicago"
0
+ end
0
+
0
+ def secret_info
0
+ permit "(matz or dhh) and interested in Answers" do
0
+ render :text => "The Answer = 42"
0
+ end
0
+ end
0
+
0
+ def find_apprentice
0
+ @founder = User.find_by_name('matz')
0
+ permit "'inner circle' of :founder" do
0
+ if request.post?
0
+ apprentice = User.find_by_skillset(params[:uber_hacker])
0
+ ruby_community = Group.find_by_name('Ruby')
0
+ ruby_community.accepts_role 'yarv_builder', apprentice
0
+ end
0
+ end
0
+ end
0
+
0
+ def rails_conf
0
+ @meeting = Meeting.find_by_name('RailsConf')
0
+ permit "attendees of :meeting or swedish_mensa_supermodels" do
0
+ venue = Hotel.find_by_name("Wyndham O'Hare")
0
+ current_user.is_traveller_to venue
0
+ if permit? "traveller to :venue and not speaker"
0
+ Partay.all_night_long
0
+ @misdeeds = current_user.is_participant_in_what
0
+ end
0
+ end
0
+ end
0
+
0
+end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0
@@ -1,20 +1,20 @@
0
-Description:
0
- The role_model generator creates a Role model for use with the Authorization plugin.
0
-
0
- The generator takes a model name as its argument, which at this time must be 'Role'.
0
-
0
- The generator creates a Role model class in app/models, a test suite in
0
- test/unit, test fixtures in test/fixtures/singular_name.yml, and a migration
0
- in db/migrate.
0
-
0
-Example:
0
- ./script/generate role_model Role
0
-
0
- This will create a Role model:
0
- Model: app/models/role.rb
0
- Test: test/unit/role_test.rb
0
- Fixtures: test/fixtures/roles.yml
0
- Migration: db/migrate/XXX_add_role.rb
0
-
0
- You should then run "rake migrate".
0
-
0
+Description:
0
+ The role_model generator creates a Role model for use with the Authorization plugin.
0
+
0
+ The generator takes a model name as its argument, which at this time must be 'Role'.
0
+
0
+ The generator creates a Role model class in app/models, a test suite in
0
+ test/unit, test fixtures in test/fixtures/roles.yml, and a migration
0
+ in the db/migrate directory.
0
+
0
+Example:
0
+ ./script/generate role_model Role
0
+
0
+ This will create a Role model:
0
+ Model: app/models/role.rb
0
+ Test: test/unit/role_test.rb
0
+ Fixtures: test/fixtures/roles.yml
0
+ Migration: db/migrate/XXX_add_role.rb
0
+
0
+ You should then run 'rake db:migrate'.
0
+

Comments

    No one has commented yet.