trydionel-acl9 0.11.01

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,54 @@
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 Bar < ActiveRecord::Base
14
+ acts_as_authorization_object
15
+ end
16
+
17
+ class AnotherSubject < ActiveRecord::Base
18
+ acts_as_authorization_subject :role_class_name => 'AnotherRole'
19
+ end
20
+
21
+ class AnotherRole < ActiveRecord::Base
22
+ acts_as_authorization_role :subject_class_name => "AnotherSubject"
23
+ end
24
+
25
+ class FooBar < ActiveRecord::Base
26
+ acts_as_authorization_object :role_class_name => 'AnotherRole', :subject_class_name => "AnotherSubject"
27
+ end
28
+
29
+ class DifferentAssociationNameSubject < ActiveRecord::Base
30
+ acts_as_authorization_subject :association_name => 'roles', :role_class_name => "DifferentAssociationNameRole"
31
+ end
32
+
33
+ class DifferentAssociationNameRole < ActiveRecord::Base
34
+ acts_as_authorization_role :subject_class_name => "DifferentAssociationNameSubject"
35
+ end
36
+
37
+ module Other
38
+
39
+ class Other::User < ActiveRecord::Base
40
+ set_table_name "other_users"
41
+ acts_as_authorization_subject :join_table_name => "other_roles_other_users", :role_class_name => "Other::Role"
42
+ end
43
+
44
+ class Other::Role < ActiveRecord::Base
45
+ set_table_name "other_roles"
46
+ acts_as_authorization_role :join_table_name => "other_roles_other_users", :subject_class_name => "Other::User"
47
+ end
48
+
49
+ class Other::FooBar < ActiveRecord::Base
50
+ set_table_name "other_foo_bars"
51
+ acts_as_authorization_object :role_class_name => 'Other::Role', :subject_class_name => "Other::User"
52
+ end
53
+
54
+ end
@@ -0,0 +1,86 @@
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.integer "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 "bars", :force => true do |t|
57
+ t.datetime "created_at"
58
+ t.datetime "updated_at"
59
+ end
60
+ create_table "foo_bars", :force => true do |t|
61
+ t.datetime "created_at"
62
+ t.datetime "updated_at"
63
+ end
64
+
65
+ # namespaced
66
+
67
+ create_table "other_roles", :force => true do |t|
68
+ t.string "name", :limit => 40
69
+ t.string "authorizable_type", :limit => 40
70
+ t.integer "authorizable_id"
71
+ t.datetime "created_at"
72
+ t.datetime "updated_at"
73
+ end
74
+ create_table "other_users", :force => true do |t| end
75
+ create_table "other_roles_other_users", :id => false, :force => true do |t|
76
+ t.integer "user_id"
77
+ t.integer "role_id"
78
+ t.datetime "created_at"
79
+ t.datetime "updated_at"
80
+ end
81
+ create_table "other_foo_bars", :force => true do |t|
82
+ t.datetime "created_at"
83
+ t.datetime "updated_at"
84
+ end
85
+
86
+ 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,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: trydionel-acl9
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.11.01
5
+ platform: ruby
6
+ authors:
7
+ - oleg dashevskii
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-16 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: jeremymcanally-context
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.5.5
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: jnunemaker-matchy
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.0
34
+ version:
35
+ description: Role-based authorization system for Rails with a nice DSL for access control lists
36
+ email: olegdashevskii@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README.textile
43
+ files:
44
+ - CHANGELOG.textile
45
+ - MIT-LICENSE
46
+ - README.textile
47
+ - Rakefile
48
+ - TODO
49
+ - VERSION.yml
50
+ - lib/acl9.rb
51
+ - lib/acl9/config.rb
52
+ - lib/acl9/controller_extensions.rb
53
+ - lib/acl9/controller_extensions/dsl_base.rb
54
+ - lib/acl9/controller_extensions/generators.rb
55
+ - lib/acl9/helpers.rb
56
+ - lib/acl9/model_extensions.rb
57
+ - lib/acl9/model_extensions/object.rb
58
+ - lib/acl9/model_extensions/subject.rb
59
+ - test/access_control_test.rb
60
+ - test/dsl_base_test.rb
61
+ - test/helpers_test.rb
62
+ - test/roles_test.rb
63
+ - test/support/controllers.rb
64
+ - test/support/models.rb
65
+ - test/support/schema.rb
66
+ - test/test_helper.rb
67
+ has_rdoc: false
68
+ homepage: http://github.com/be9/acl9
69
+ licenses:
70
+ post_install_message:
71
+ rdoc_options:
72
+ - --charset=UTF-8
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "0"
86
+ version:
87
+ requirements: []
88
+
89
+ rubyforge_project:
90
+ rubygems_version: 1.3.5
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Yet another role-based authorization system for Rails
94
+ test_files:
95
+ - test/dsl_base_test.rb
96
+ - test/test_helper.rb
97
+ - test/access_control_test.rb
98
+ - test/support/schema.rb
99
+ - test/support/models.rb
100
+ - test/support/controllers.rb
101
+ - test/helpers_test.rb
102
+ - test/roles_test.rb