jrun-rails_doorman 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. data/LICENSE +21 -0
  2. data/README.rdoc +88 -0
  3. data/Rakefile +57 -0
  4. data/features/doorman.feature +99 -0
  5. data/features/step_definitions/common_steps.rb +25 -0
  6. data/features/step_definitions/webrat_steps.rb +115 -0
  7. data/features/support/authorized_matcher.rb +29 -0
  8. data/features/support/env.rb +13 -0
  9. data/features/support/paths.rb +19 -0
  10. data/features/support/unauthorized_matcher.rb +29 -0
  11. data/lib/rails_doorman/helpers.rb +17 -0
  12. data/lib/rails_doorman/rule.rb +59 -0
  13. data/lib/rails_doorman.rb +111 -0
  14. data/rails/init.rb +1 -0
  15. data/spec/fixtures/app/README +243 -0
  16. data/spec/fixtures/app/Rakefile +10 -0
  17. data/spec/fixtures/app/app/controllers/access_control_by_host_controller.rb +5 -0
  18. data/spec/fixtures/app/app/controllers/access_control_by_user_agent_controller.rb +4 -0
  19. data/spec/fixtures/app/app/controllers/allow_all_by_default_controller.rb +2 -0
  20. data/spec/fixtures/app/app/controllers/allowed_and_denied_roles_controller.rb +4 -0
  21. data/spec/fixtures/app/app/controllers/allowed_and_denied_users_controller.rb +4 -0
  22. data/spec/fixtures/app/app/controllers/allowed_role_controller.rb +3 -0
  23. data/spec/fixtures/app/app/controllers/allowed_role_with_only_controller.rb +3 -0
  24. data/spec/fixtures/app/app/controllers/allowed_user_controller.rb +3 -0
  25. data/spec/fixtures/app/app/controllers/application_controller.rb +36 -0
  26. data/spec/fixtures/app/app/controllers/denied_role_controller.rb +3 -0
  27. data/spec/fixtures/app/app/controllers/denied_user_controller.rb +4 -0
  28. data/spec/fixtures/app/app/controllers/deny_all_controller.rb +3 -0
  29. data/spec/fixtures/app/app/controllers/explicitly_allow_all_controller.rb +3 -0
  30. data/spec/fixtures/app/app/controllers/test_controller.rb +4 -0
  31. data/spec/fixtures/app/app/controllers/view_helpers_controller.rb +4 -0
  32. data/spec/fixtures/app/app/helpers/application_helper.rb +3 -0
  33. data/spec/fixtures/app/app/models/user.rb +7 -0
  34. data/spec/fixtures/app/app/views/layouts/application.html.erb +8 -0
  35. data/spec/fixtures/app/app/views/view_helpers/allow_via_role.html.erb +3 -0
  36. data/spec/fixtures/app/app/views/view_helpers/deny_via_role.html.erb +3 -0
  37. data/spec/fixtures/app/config/boot.rb +110 -0
  38. data/spec/fixtures/app/config/environment.rb +41 -0
  39. data/spec/fixtures/app/config/environments/development.rb +0 -0
  40. data/spec/fixtures/app/config/environments/production.rb +0 -0
  41. data/spec/fixtures/app/config/environments/test.rb +31 -0
  42. data/spec/fixtures/app/config/initializers/backtrace_silencers.rb +7 -0
  43. data/spec/fixtures/app/config/initializers/inflections.rb +10 -0
  44. data/spec/fixtures/app/config/initializers/mime_types.rb +5 -0
  45. data/spec/fixtures/app/config/initializers/new_rails_defaults.rb +19 -0
  46. data/spec/fixtures/app/config/initializers/session_store.rb +15 -0
  47. data/spec/fixtures/app/config/locales/en.yml +5 -0
  48. data/spec/fixtures/app/config/routes.rb +43 -0
  49. data/spec/fixtures/app/db/foo.txt +0 -0
  50. data/spec/fixtures/app/doc/README_FOR_APP +2 -0
  51. data/spec/fixtures/app/public/404.html +30 -0
  52. data/spec/fixtures/app/public/422.html +30 -0
  53. data/spec/fixtures/app/public/500.html +30 -0
  54. data/spec/fixtures/app/public/favicon.ico +0 -0
  55. data/spec/fixtures/app/public/images/rails.png +0 -0
  56. data/spec/fixtures/app/public/javascripts/application.js +2 -0
  57. data/spec/fixtures/app/public/javascripts/controls.js +963 -0
  58. data/spec/fixtures/app/public/javascripts/dragdrop.js +973 -0
  59. data/spec/fixtures/app/public/javascripts/effects.js +1128 -0
  60. data/spec/fixtures/app/public/javascripts/prototype.js +4320 -0
  61. data/spec/fixtures/app/public/robots.txt +5 -0
  62. data/spec/fixtures/app/script/about +4 -0
  63. data/spec/fixtures/app/script/console +3 -0
  64. data/spec/fixtures/app/script/dbconsole +3 -0
  65. data/spec/fixtures/app/script/destroy +3 -0
  66. data/spec/fixtures/app/script/generate +3 -0
  67. data/spec/fixtures/app/script/performance/benchmarker +3 -0
  68. data/spec/fixtures/app/script/performance/profiler +3 -0
  69. data/spec/fixtures/app/script/plugin +3 -0
  70. data/spec/fixtures/app/script/runner +3 -0
  71. data/spec/fixtures/app/script/server +3 -0
  72. data/spec/fixtures/app/test/performance/browsing_test.rb +9 -0
  73. data/spec/fixtures/app/test/test_helper.rb +38 -0
  74. data/spec/fixtures/app/vendor/plugins/doorman/init.rb +1 -0
  75. data/spec/rails_doorman/class_methods_spec.rb +49 -0
  76. data/spec/rails_doorman/rule_spec.rb +120 -0
  77. data/spec/spec_helper.rb +15 -0
  78. metadata +176 -0
@@ -0,0 +1,43 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+
4
+ # Sample of regular route:
5
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6
+ # Keep in mind you can assign values other than :controller and :action
7
+
8
+ # Sample of named route:
9
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
10
+ # This route can be invoked with purchase_url(:id => product.id)
11
+
12
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
13
+ # map.resources :products
14
+
15
+ # Sample resource route with options:
16
+ # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
17
+
18
+ # Sample resource route with sub-resources:
19
+ # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
20
+
21
+ # Sample resource route with more complex sub-resources
22
+ # map.resources :products do |products|
23
+ # products.resources :comments
24
+ # products.resources :sales, :collection => { :recent => :get }
25
+ # end
26
+
27
+ # Sample resource route within a namespace:
28
+ # map.namespace :admin do |admin|
29
+ # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
30
+ # admin.resources :products
31
+ # end
32
+
33
+ # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
34
+ # map.root :controller => "welcome"
35
+
36
+ # See how all your routes lay out with "rake routes"
37
+
38
+ # Install the default routes as the lowest priority.
39
+ # Note: These default routes make all actions in every controller accessible via GET requests. You should
40
+ # consider removing the them or commenting them out if you're using named routes and resources.
41
+ map.connect ':controller/:action/:id'
42
+ map.connect ':controller/:action/:id.:format'
43
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>The page you were looking for doesn't exist (404)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/404.html -->
25
+ <div class="dialog">
26
+ <h1>The page you were looking for doesn't exist.</h1>
27
+ <p>You may have mistyped the address or the page may have moved.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>The change you wanted was rejected (422)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/422.html -->
25
+ <div class="dialog">
26
+ <h1>The change you wanted was rejected.</h1>
27
+ <p>Maybe you tried to change something you didn't have access to.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>We're sorry, but something went wrong (500)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/500.html -->
25
+ <div class="dialog">
26
+ <h1>We're sorry, but something went wrong.</h1>
27
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
28
+ </div>
29
+ </body>
30
+ </html>
File without changes
@@ -0,0 +1,2 @@
1
+ // Place your application-specific JavaScript functions and classes here
2
+ // This file is automatically included by javascript_include_tag :defaults