ktopping_acl9 0.12.0

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.
@@ -0,0 +1,59 @@
1
+ class Role < ActiveRecord::Base
2
+ acts_as_authorization_role
3
+ end
4
+
5
+ class User < ActiveRecord::Base
6
+ acts_as_authorization_subject
7
+ end
8
+
9
+ class Foo < ActiveRecord::Base
10
+ acts_as_authorization_object
11
+ end
12
+
13
+ class Uuid < ActiveRecord::Base
14
+ set_primary_key "uuid"
15
+ acts_as_authorization_object
16
+ end
17
+
18
+ class Bar < ActiveRecord::Base
19
+ acts_as_authorization_object
20
+ end
21
+
22
+ class AnotherSubject < ActiveRecord::Base
23
+ acts_as_authorization_subject :role_class_name => 'AnotherRole'
24
+ end
25
+
26
+ class AnotherRole < ActiveRecord::Base
27
+ acts_as_authorization_role :subject_class_name => "AnotherSubject"
28
+ end
29
+
30
+ class FooBar < ActiveRecord::Base
31
+ acts_as_authorization_object :role_class_name => 'AnotherRole', :subject_class_name => "AnotherSubject"
32
+ end
33
+
34
+ class DifferentAssociationNameSubject < ActiveRecord::Base
35
+ acts_as_authorization_subject :association_name => 'roles', :role_class_name => "DifferentAssociationNameRole"
36
+ end
37
+
38
+ class DifferentAssociationNameRole < ActiveRecord::Base
39
+ acts_as_authorization_role :subject_class_name => "DifferentAssociationNameSubject"
40
+ end
41
+
42
+ module Other
43
+
44
+ class Other::User < ActiveRecord::Base
45
+ set_table_name "other_users"
46
+ acts_as_authorization_subject :join_table_name => "other_roles_other_users", :role_class_name => "Other::Role"
47
+ end
48
+
49
+ class Other::Role < ActiveRecord::Base
50
+ set_table_name "other_roles"
51
+ acts_as_authorization_role :join_table_name => "other_roles_other_users", :subject_class_name => "Other::User"
52
+ end
53
+
54
+ class Other::FooBar < ActiveRecord::Base
55
+ set_table_name "other_foo_bars"
56
+ acts_as_authorization_object :role_class_name => 'Other::Role', :subject_class_name => "Other::User"
57
+ end
58
+
59
+ end
@@ -0,0 +1,92 @@
1
+ ActiveRecord::Schema.define(:version => 0) do
2
+ create_table "roles", :force => true do |t|
3
+ t.string "name", :limit => 40
4
+ t.string "authorizable_type", :limit => 40
5
+ t.string "authorizable_id"
6
+ t.datetime "created_at"
7
+ t.datetime "updated_at"
8
+ end
9
+
10
+ create_table "another_roles", :force => true do |t|
11
+ t.string "name", :limit => 40
12
+ t.string "authorizable_type", :limit => 40
13
+ t.integer "authorizable_id"
14
+ t.datetime "created_at"
15
+ t.datetime "updated_at"
16
+ end
17
+
18
+ create_table "different_association_name_roles", :force => true do |t|
19
+ t.string "name", :limit => 40
20
+ t.string "authorizable_type", :limit => 40
21
+ t.integer "authorizable_id"
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
+ end
25
+
26
+ create_table "users", :force => true do |t| end
27
+ create_table "another_subjects", :force => true do |t| end
28
+ create_table "different_association_name_subjects", :force => true do |t| end
29
+
30
+ create_table "roles_users", :id => false, :force => true do |t|
31
+ t.integer "user_id"
32
+ t.integer "role_id"
33
+ t.datetime "created_at"
34
+ t.datetime "updated_at"
35
+ end
36
+
37
+ create_table "another_roles_another_subjects", :id => false, :force => true do |t|
38
+ t.integer "another_subject_id"
39
+ t.integer "another_role_id"
40
+ t.datetime "created_at"
41
+ t.datetime "updated_at"
42
+ end
43
+
44
+ create_table "different_association_name_roles_different_association_name_subjects", :id => false, :force => true do |t|
45
+ t.integer "different_association_name_subject_id"
46
+ t.integer "different_association_name_role_id"
47
+ t.datetime "created_at"
48
+ t.datetime "updated_at"
49
+ end
50
+
51
+ create_table "foos", :force => true do |t|
52
+ t.datetime "created_at"
53
+ t.datetime "updated_at"
54
+ end
55
+
56
+ create_table "uuids", :id => false, :force => true do |t|
57
+ t.string "uuid"
58
+ t.datetime "created_at"
59
+ t.datetime "updated_at"
60
+ end
61
+
62
+ create_table "bars", :force => true do |t|
63
+ t.datetime "created_at"
64
+ t.datetime "updated_at"
65
+ end
66
+ create_table "foo_bars", :force => true do |t|
67
+ t.datetime "created_at"
68
+ t.datetime "updated_at"
69
+ end
70
+
71
+ # namespaced
72
+
73
+ create_table "other_roles", :force => true do |t|
74
+ t.string "name", :limit => 40
75
+ t.string "authorizable_type", :limit => 40
76
+ t.integer "authorizable_id"
77
+ t.datetime "created_at"
78
+ t.datetime "updated_at"
79
+ end
80
+ create_table "other_users", :force => true do |t| end
81
+ create_table "other_roles_other_users", :id => false, :force => true do |t|
82
+ t.integer "user_id"
83
+ t.integer "role_id"
84
+ t.datetime "created_at"
85
+ t.datetime "updated_at"
86
+ end
87
+ create_table "other_foo_bars", :force => true do |t|
88
+ t.datetime "created_at"
89
+ t.datetime "updated_at"
90
+ end
91
+
92
+ end
@@ -0,0 +1,31 @@
1
+ require 'rubygems'
2
+
3
+ gem 'jnunemaker-matchy', '>= 0.4.0'
4
+ gem 'jeremymcanally-context', '>= 0.5.5'
5
+
6
+ require 'test/unit'
7
+ require 'context'
8
+ require 'matchy'
9
+ require 'active_support'
10
+ require 'active_record'
11
+ require 'action_controller'
12
+ require 'action_controller/test_process'
13
+
14
+ ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :dbfile => 'test.sqlite3')
15
+
16
+ class Test::Unit::TestCase
17
+ custom_matcher :be_false do |receiver, matcher, args|
18
+ !receiver
19
+ end
20
+
21
+ custom_matcher :be_true do |receiver, matcher, args|
22
+ !!receiver
23
+ end
24
+ end
25
+
26
+ ActionController::Routing::Routes.draw do |map|
27
+ map.connect ":controller/:action/:id"
28
+ end
29
+
30
+ ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
31
+ ActionController::Base.logger = ActiveRecord::Base.logger
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ktopping_acl9
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 12
8
+ - 0
9
+ version: 0.12.0
10
+ platform: ruby
11
+ authors:
12
+ - oleg dashevskii
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-29 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: jeremymcanally-context
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 5
30
+ - 5
31
+ version: 0.5.5
32
+ type: :development
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: jnunemaker-matchy
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 4
44
+ - 0
45
+ version: 0.4.0
46
+ type: :development
47
+ version_requirements: *id002
48
+ description: Role-based authorization system for Rails with a nice DSL for access control lists
49
+ email: kieran@getcontentment.com
50
+ executables: []
51
+
52
+ extensions: []
53
+
54
+ extra_rdoc_files:
55
+ - README.textile
56
+ - TODO
57
+ files:
58
+ - CHANGELOG.textile
59
+ - MIT-LICENSE
60
+ - README.textile
61
+ - Rakefile
62
+ - TODO
63
+ - VERSION.yml
64
+ - lib/acl9.rb
65
+ - lib/acl9/config.rb
66
+ - lib/acl9/controller_extensions.rb
67
+ - lib/acl9/controller_extensions/dsl_base.rb
68
+ - lib/acl9/controller_extensions/generators.rb
69
+ - lib/acl9/helpers.rb
70
+ - lib/acl9/model_extensions.rb
71
+ - lib/acl9/model_extensions/for_object.rb
72
+ - lib/acl9/model_extensions/for_subject.rb
73
+ - test/access_control_test.rb
74
+ - test/dsl_base_test.rb
75
+ - test/helpers_test.rb
76
+ - test/roles_test.rb
77
+ - test/support/controllers.rb
78
+ - test/support/models.rb
79
+ - test/support/schema.rb
80
+ - test/test_helper.rb
81
+ has_rdoc: true
82
+ homepage: http://github.com/ktopping/acl9
83
+ licenses: []
84
+
85
+ post_install_message:
86
+ rdoc_options:
87
+ - --charset=UTF-8
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ requirements: []
105
+
106
+ rubyforge_project:
107
+ rubygems_version: 1.3.6
108
+ signing_key:
109
+ specification_version: 3
110
+ summary: Yet another role-based authorization system for Rails
111
+ test_files:
112
+ - test/support/schema.rb
113
+ - test/support/models.rb
114
+ - test/support/controllers.rb
115
+ - test/access_control_test.rb
116
+ - test/helpers_test.rb
117
+ - test/test_helper.rb
118
+ - test/roles_test.rb
119
+ - test/dsl_base_test.rb