has_roles 0.0.2 → 0.3.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.
- data/CHANGELOG.rdoc +46 -0
- data/{MIT-LICENSE → LICENSE} +2 -2
- data/README.rdoc +92 -0
- data/Rakefile +49 -39
- data/app/models/permission.rb +48 -31
- data/app/models/role.rb +32 -24
- data/app/models/role_assignment.rb +5 -6
- data/app/models/role_permission.rb +25 -0
- data/db/migrate/{002_create_permissions.rb → 001_create_permissions.rb} +4 -5
- data/db/migrate/{003_create_roles.rb → 002_create_roles.rb} +1 -3
- data/db/migrate/003_create_role_permissions.rb +11 -0
- data/db/migrate/{005_create_role_assignments.rb → 004_create_role_assignments.rb} +2 -3
- data/lib/has_roles/authorization_helper.rb +66 -47
- data/lib/has_roles/url_helper.rb +38 -0
- data/lib/has_roles.rb +29 -56
- data/test/app_root/app/controllers/admin/base_controller.rb +2 -0
- data/test/app_root/app/controllers/admin/users_controller.rb +10 -1
- data/test/app_root/app/controllers/application_controller.rb +7 -0
- data/test/app_root/config/environment.rb +6 -19
- data/test/app_root/config/routes.rb +1 -0
- data/test/app_root/db/migrate/001_create_users.rb +1 -1
- data/test/app_root/db/migrate/002_migrate_has_roles_to_version_4.rb +13 -0
- data/test/factory.rb +63 -0
- data/test/functional/application_controller_test.rb +45 -0
- data/test/functional/has_roles_test.rb +68 -0
- data/test/helpers/authorization_helper_test.rb +92 -0
- data/test/helpers/url_helper_test.rb +35 -0
- data/test/test_helper.rb +13 -4
- data/test/unit/permission_test.rb +92 -27
- data/test/unit/role_assignment_test.rb +46 -15
- data/test/unit/role_permission_test.rb +34 -0
- data/test/unit/role_test.rb +122 -20
- metadata +93 -78
- data/CHANGELOG +0 -19
- data/README +0 -83
- data/app/models/controller.rb +0 -82
- data/db/migrate/001_create_controllers.rb +0 -13
- data/db/migrate/004_create_permissions_roles.rb +0 -13
- data/test/app_root/app/controllers/payment/pay_pal/transactions_controller.rb +0 -2
- data/test/app_root/app/controllers/payment/transactions_controller.rb +0 -2
- data/test/fixtures/controllers.yml +0 -19
- data/test/fixtures/permissions.yml +0 -27
- data/test/fixtures/permissions_roles.yml +0 -15
- data/test/fixtures/role_assignments.yml +0 -17
- data/test/fixtures/roles.yml +0 -11
- data/test/fixtures/users.yml +0 -11
- data/test/unit/authorization_helper_test.rb +0 -40
- data/test/unit/controller_test.rb +0 -95
- data/test/unit/has_roles_test.rb +0 -49
@@ -1,53 +1,118 @@
|
|
1
|
-
require
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
|
-
class
|
4
|
-
|
3
|
+
class PermissionByDefaultTest < ActiveRecord::TestCase
|
4
|
+
def setup
|
5
|
+
@permission = Permission.new
|
6
|
+
end
|
5
7
|
|
6
|
-
def
|
7
|
-
|
8
|
+
def test_should_not_have_a_controller
|
9
|
+
assert @permission.controller.blank?
|
8
10
|
end
|
9
11
|
|
10
|
-
def
|
11
|
-
|
12
|
+
def test_should_not_have_an_action
|
13
|
+
assert @permission.action.blank?
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
|
16
|
+
def test_should_not_have_a_path
|
17
|
+
assert @permission.path.blank?
|
16
18
|
end
|
17
19
|
|
18
|
-
def
|
19
|
-
|
20
|
+
def test_should_use_controller_as_path_if_not_specified
|
21
|
+
permission = Permission.new(:controller => 'users')
|
22
|
+
permission.valid?
|
23
|
+
assert_equal 'users/', permission.path
|
20
24
|
end
|
21
25
|
|
22
|
-
def
|
23
|
-
|
26
|
+
def test_should_use_controller_and_action_as_path_if_not_specified
|
27
|
+
permission = Permission.new(:controller => 'users', :action => 'index')
|
28
|
+
permission.valid?
|
29
|
+
assert_equal 'users/index', permission.path
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class PermissionTest < ActiveRecord::TestCase
|
34
|
+
def test_should_be_valid_with_a_valid_set_of_attributes
|
35
|
+
permission = new_permission
|
36
|
+
assert permission.valid?
|
24
37
|
end
|
25
38
|
|
26
|
-
def
|
27
|
-
|
39
|
+
def test_should_require_a_controller
|
40
|
+
permission = new_permission(:controller => nil)
|
41
|
+
assert !permission.valid?
|
42
|
+
assert permission.errors.invalid?(:controller)
|
28
43
|
end
|
29
44
|
|
30
|
-
def
|
31
|
-
|
45
|
+
def test_should_not_require_an_action
|
46
|
+
permission = new_permission(:action => nil)
|
47
|
+
assert permission.valid?
|
32
48
|
end
|
33
49
|
|
34
|
-
def
|
35
|
-
|
50
|
+
def test_should_require_at_least_1_character_if_action_is_specified
|
51
|
+
permission = new_permission(:action => '')
|
52
|
+
assert !permission.valid?
|
53
|
+
assert permission.errors.invalid?(:action)
|
36
54
|
end
|
37
55
|
|
38
|
-
def
|
39
|
-
|
56
|
+
def test_should_require_a_unique_path
|
57
|
+
permission = create_permission(:controller => 'application')
|
58
|
+
|
59
|
+
second_permission = new_permission(:controller => 'application')
|
60
|
+
assert !second_permission.valid?
|
61
|
+
assert second_permission.errors.invalid?(:path)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
class PermissionAfterBeingCreatedTest < ActiveRecord::TestCase
|
66
|
+
def setup
|
67
|
+
@permission = create_permission(:controller => 'application')
|
40
68
|
end
|
41
69
|
|
42
|
-
def
|
43
|
-
|
70
|
+
def test_should_have_a_path
|
71
|
+
assert_equal 'application/', @permission.path
|
44
72
|
end
|
45
73
|
|
46
|
-
def
|
47
|
-
assert
|
74
|
+
def test_should_have_no_assigned_roles
|
75
|
+
assert @permission.assigned_roles.empty?
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_should_have_no_roles
|
79
|
+
assert @permission.roles.empty?
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class PermissionPathRecognitionTest < ActiveRecord::TestCase
|
84
|
+
def test_should_recognize_by_relative_url
|
85
|
+
assert_equal ['users', 'index'], Permission.recognize_path('/users')
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_should_recognize_by_relative_url_with_namespace
|
89
|
+
assert_equal ['admin/users', 'update'], Permission.recognize_path('/admin/users/update')
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_should_recognize_by_absolute_url
|
93
|
+
assert_equal ['users', 'index'], Permission.recognize_path('http://localhost:3000/users')
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_should_recognize_by_hash
|
97
|
+
assert_equal ['users', 'index'], Permission.recognize_path(:controller => 'users', :action => 'index')
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_should_recognize_by_hash_with_namespace
|
101
|
+
assert_equal ['admin/users', 'update'], Permission.recognize_path(:controller => 'admin/users', :action => 'update', :id => 1)
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_should_recognize_if_action_not_specified
|
105
|
+
assert_equal ['users', 'index'], Permission.recognize_path(:controller => 'users')
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
class PermissionRestrictionTest < ActiveRecord::TestCase
|
110
|
+
def test_should_restrict_if_permission_exists_for_path
|
111
|
+
create_permission(:controller => 'application')
|
112
|
+
assert Permission.restricts?(:controller => 'application')
|
48
113
|
end
|
49
114
|
|
50
|
-
def
|
51
|
-
|
115
|
+
def test_should_not_restrict_if_no_permission_exists_for_path
|
116
|
+
assert !Permission.restricts?('/users')
|
52
117
|
end
|
53
118
|
end
|
@@ -1,29 +1,60 @@
|
|
1
|
-
require
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
|
-
class
|
4
|
-
|
3
|
+
class RoleAssignmentByDefaultTest < ActiveRecord::TestCase
|
4
|
+
def setup
|
5
|
+
@role_assignment = RoleAssignment.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_should_not_have_a_role
|
9
|
+
assert_nil @role_assignment.role_id
|
10
|
+
end
|
5
11
|
|
6
|
-
def
|
7
|
-
|
12
|
+
def test_should_not_have_an_assignee
|
13
|
+
assert_nil @role_assignment.assignee_id
|
8
14
|
end
|
9
15
|
|
10
|
-
def
|
11
|
-
|
16
|
+
def test_should_not_have_an_assignee_type
|
17
|
+
assert @role_assignment.assignee_type.blank?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class RoleAssignmentTest < ActiveRecord::TestCase
|
22
|
+
def test_should_be_valid_with_a_valid_set_of_attributes
|
23
|
+
role_assignment = new_role_assignment
|
24
|
+
assert role_assignment.valid?
|
12
25
|
end
|
13
26
|
|
14
|
-
def
|
15
|
-
|
27
|
+
def test_should_require_a_role
|
28
|
+
role_assignment = new_role_assignment(:role => nil)
|
29
|
+
assert !role_assignment.valid?
|
30
|
+
assert role_assignment.errors.invalid?(:role_id)
|
16
31
|
end
|
17
32
|
|
18
|
-
def
|
19
|
-
|
33
|
+
def test_should_require_an_assignee_id
|
34
|
+
role_assignment = new_role_assignment(:assignee => nil)
|
35
|
+
assert !role_assignment.valid?
|
36
|
+
assert role_assignment.errors.invalid?(:assignee_id)
|
20
37
|
end
|
21
38
|
|
22
|
-
def
|
23
|
-
|
39
|
+
def test_should_require_an_assignee_type
|
40
|
+
role_assignment = new_role_assignment(:assignee => nil)
|
41
|
+
assert !role_assignment.valid?
|
42
|
+
assert role_assignment.errors.invalid?(:assignee_type)
|
24
43
|
end
|
25
44
|
|
26
|
-
def
|
27
|
-
|
45
|
+
def test_should_protect_attributes_from_mass_assignment
|
46
|
+
create_role(:name => 'admin')
|
47
|
+
|
48
|
+
role_assignment = RoleAssignment.new(
|
49
|
+
:id => 123,
|
50
|
+
:assignee_id => 1,
|
51
|
+
:assignee_type => 'User',
|
52
|
+
:role => 'admin'
|
53
|
+
)
|
54
|
+
|
55
|
+
assert_nil role_assignment.id
|
56
|
+
assert_nil role_assignment.assignee_id
|
57
|
+
assert_nil role_assignment.assignee_type
|
58
|
+
assert_equal 'admin', role_assignment.role
|
28
59
|
end
|
29
60
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
|
3
|
+
class RolePermissionByDefaultTest < ActiveRecord::TestCase
|
4
|
+
def setup
|
5
|
+
@role_permission = RolePermission.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_should_not_have_a_role
|
9
|
+
assert_nil @role_permission.role_id
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_should_not_have_a_permission
|
13
|
+
assert_nil @role_permission.permission_id
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class RolePermissionTest < ActiveRecord::TestCase
|
18
|
+
def test_should_be_valid_with_a_valid_set_of_attributes
|
19
|
+
role_permission = new_role_permission
|
20
|
+
assert role_permission.valid?
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_should_require_a_role
|
24
|
+
role_permission = new_role_permission(:role => nil)
|
25
|
+
assert !role_permission.valid?
|
26
|
+
assert role_permission.errors.invalid?(:role_id)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_should_require_a_permission
|
30
|
+
role_permission = new_role_permission(:permission => nil)
|
31
|
+
assert !role_permission.valid?
|
32
|
+
assert role_permission.errors.invalid?(:permission_id)
|
33
|
+
end
|
34
|
+
end
|
data/test/unit/role_test.rb
CHANGED
@@ -1,38 +1,140 @@
|
|
1
|
-
require
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
|
-
class
|
4
|
-
|
3
|
+
class RoleByDefaultTest < ActiveRecord::TestCase
|
4
|
+
def setup
|
5
|
+
@role = Role.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_should_not_have_a_name
|
9
|
+
assert @role.name.blank?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class RoleTest < ActiveRecord::TestCase
|
14
|
+
def test_should_be_valid_with_a_valid_set_of_attributes
|
15
|
+
role = new_role
|
16
|
+
assert role.valid?
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_should_require_a_name
|
20
|
+
role = new_role(:name => nil)
|
21
|
+
assert !role.valid?
|
22
|
+
assert role.errors.invalid?(:name)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_should_require_a_unique_name
|
26
|
+
role = create_role(:name => 'admin')
|
27
|
+
|
28
|
+
second_role = new_role(:name => 'admin')
|
29
|
+
assert !second_role.valid?
|
30
|
+
assert second_role.errors.invalid?(:name)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class RoleAfterBeingCreatedTest < ActiveRecord::TestCase
|
35
|
+
def setup
|
36
|
+
@role = create_role
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_should_not_have_any_assigned_permissions
|
40
|
+
assert @role.permissions.empty?
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_should_not_have_any_permissions
|
44
|
+
assert @role.permissions.empty?
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_should_not_have_any_assignments
|
48
|
+
assert @role.assignments.empty?
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class RoleWithPermissionsTest < ActiveRecord::TestCase
|
53
|
+
def setup
|
54
|
+
@role = create_role
|
55
|
+
@permission_create = create_permission(:controller => 'users', :action => 'create')
|
56
|
+
@permission_update = create_permission(:controller => 'users', :action => 'update')
|
57
|
+
|
58
|
+
create_role_permission(:role => @role, :permission => @permission_create)
|
59
|
+
create_role_permission(:role => @role, :permission => @permission_update)
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_should_have_assigned_permissions
|
63
|
+
assert_equal [@permission_create, @permission_update], @role.assigned_permissions.map(&:permission)
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_should_have_permissions
|
67
|
+
assert_equal [@permission_create, @permission_update], @role.permissions
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
class RoleWithAssignmentsTest < ActiveRecord::TestCase
|
72
|
+
def setup
|
73
|
+
@role = create_role
|
74
|
+
|
75
|
+
@administrator = create_role_assignment(:role => @role, :assignee => create_user(:login => 'admin'))
|
76
|
+
@developer = create_role_assignment(:role => @role, :assignee => create_user(:login => 'dev'))
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_should_have_assignments
|
80
|
+
assert_equal [@administrator, @developer], @role.assignments
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
class RoleAuthorizedForScopeTest < ActiveRecord::TestCase
|
85
|
+
def setup
|
86
|
+
@role = create_role
|
87
|
+
@permission_create = create_permission(:controller => 'users', :action => 'create')
|
88
|
+
@permission_update = create_permission(:controller => 'users', :action => 'update')
|
89
|
+
|
90
|
+
create_role_permission(:role => @role, :permission => @permission_create)
|
91
|
+
create_role_permission(:role => @role, :permission => @permission_update)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_should_authorize_for_a_relative_url
|
95
|
+
assert_equal [@role], Role.authorized_for('/users/create')
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_should_not_authorize_for_a_relative_url_if_not_permissioned
|
99
|
+
assert_equal [], Role.authorized_for('/admin/users/create')
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_should_authorize_for_an_absolute_url
|
103
|
+
assert_equal [@role], Role.authorized_for('http://localhost:3000/users/create')
|
104
|
+
end
|
5
105
|
|
6
|
-
def
|
7
|
-
|
106
|
+
def test_should_not_authorize_for_an_absolute_url_if_not_permissioned
|
107
|
+
assert_equal [], Role.authorized_for('http://localhost:3000/users/edit')
|
8
108
|
end
|
9
109
|
|
10
|
-
def
|
11
|
-
|
110
|
+
def test_should_authorize_for_a_controller
|
111
|
+
create_role_permission(:role => @role, :permission => create_permission(:controller => 'users'))
|
112
|
+
assert_equal [@role], Role.authorized_for(:controller => 'users')
|
12
113
|
end
|
13
114
|
|
14
|
-
def
|
15
|
-
|
115
|
+
def test_should_not_authorize_for_a_controller_if_not_permissioned
|
116
|
+
assert_equal [], Role.authorized_for(:controller => 'admin/users')
|
16
117
|
end
|
17
118
|
|
18
|
-
def
|
19
|
-
assert_equal [
|
119
|
+
def test_should_authorize_for_a_controller_and_action
|
120
|
+
assert_equal [@role], Role.authorized_for(:controller => 'users', :action => 'create')
|
20
121
|
end
|
21
122
|
|
22
|
-
def
|
23
|
-
assert_equal [
|
123
|
+
def test_should_not_authorize_for_a_controller_and_action_if_not_permissioned
|
124
|
+
assert_equal [], Role.authorized_for(:controller => 'users', :action => 'edit')
|
24
125
|
end
|
25
126
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
127
|
+
def test_should_authorize_for_the_entire_application
|
128
|
+
create_role_permission(:role => @role, :permission => create_permission(:controller => 'application'))
|
129
|
+
assert_equal [@role], Role.authorized_for(:controller => 'application')
|
29
130
|
end
|
30
131
|
|
31
|
-
def
|
32
|
-
assert_equal
|
132
|
+
def test_should_not_authorize_for_the_entire_application_if_not_permissioned
|
133
|
+
assert_equal [], Role.authorized_for(:controller => 'application')
|
33
134
|
end
|
34
135
|
|
35
|
-
def
|
36
|
-
|
136
|
+
def test_should_authorize_if_permissioned_for_superclass_controller
|
137
|
+
create_role_permission(:role => @role, :permission => create_permission(:controller => 'admin/base'))
|
138
|
+
assert_equal [@role], Role.authorized_for('/admin/users')
|
37
139
|
end
|
38
140
|
end
|
metadata
CHANGED
@@ -1,103 +1,118 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: has_roles
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0
|
7
|
-
date: 2007-09-26 00:00:00 -04:00
|
8
|
-
summary: Provides simple role management based on controllers/actions
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: info@pluginaweek.org
|
12
|
-
homepage: http://www.pluginaweek.org
|
13
|
-
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire: has_roles
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: 0.3.0
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
|
-
- Aaron Pfeifer
|
7
|
+
- Aaron Pfeifer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-04-30 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: enumerate_by
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.4.0
|
24
|
+
version:
|
25
|
+
description:
|
26
|
+
email: aaron@pluginaweek.org
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
31
33
|
files:
|
32
34
|
- app/models
|
33
35
|
- app/models/role.rb
|
34
|
-
- app/models/
|
35
|
-
- app/models/role_assignment.rb
|
36
|
+
- app/models/role_permission.rb
|
36
37
|
- app/models/permission.rb
|
38
|
+
- app/models/role_assignment.rb
|
37
39
|
- db/migrate
|
38
|
-
- db/migrate/
|
39
|
-
- db/migrate/
|
40
|
-
- db/migrate/
|
41
|
-
- db/migrate/
|
42
|
-
- db/migrate/002_create_permissions.rb
|
43
|
-
- lib/has_roles.rb
|
40
|
+
- db/migrate/003_create_role_permissions.rb
|
41
|
+
- db/migrate/004_create_role_assignments.rb
|
42
|
+
- db/migrate/002_create_roles.rb
|
43
|
+
- db/migrate/001_create_permissions.rb
|
44
44
|
- lib/has_roles
|
45
|
+
- lib/has_roles/url_helper.rb
|
45
46
|
- lib/has_roles/authorization_helper.rb
|
47
|
+
- lib/has_roles.rb
|
48
|
+
- test/factory.rb
|
46
49
|
- test/test_helper.rb
|
47
|
-
- test/
|
48
|
-
- test/
|
50
|
+
- test/functional
|
51
|
+
- test/functional/has_roles_test.rb
|
52
|
+
- test/functional/application_controller_test.rb
|
49
53
|
- test/unit
|
50
|
-
- test/
|
51
|
-
- test/
|
52
|
-
- test/
|
53
|
-
- test/
|
54
|
-
- test/
|
55
|
-
- test/
|
56
|
-
- test/
|
57
|
-
- test/app_root
|
54
|
+
- test/unit/role_test.rb
|
55
|
+
- test/unit/role_assignment_test.rb
|
56
|
+
- test/unit/role_permission_test.rb
|
57
|
+
- test/unit/permission_test.rb
|
58
|
+
- test/helpers
|
59
|
+
- test/helpers/url_helper_test.rb
|
60
|
+
- test/helpers/authorization_helper_test.rb
|
61
|
+
- test/app_root
|
58
62
|
- test/app_root/db
|
59
|
-
- test/app_root/
|
63
|
+
- test/app_root/db/migrate
|
64
|
+
- test/app_root/db/migrate/001_create_users.rb
|
65
|
+
- test/app_root/db/migrate/002_migrate_has_roles_to_version_4.rb
|
66
|
+
- test/app_root/config
|
60
67
|
- test/app_root/config/environment.rb
|
61
|
-
- test/app_root/
|
68
|
+
- test/app_root/config/routes.rb
|
69
|
+
- test/app_root/app
|
62
70
|
- test/app_root/app/controllers
|
63
|
-
- test/app_root/app/models/user.rb
|
64
|
-
- test/app_root/app/controllers/payment
|
65
|
-
- test/app_root/app/controllers/users_controller.rb
|
66
|
-
- test/app_root/app/controllers/admin
|
67
71
|
- test/app_root/app/controllers/home_controller.rb
|
68
|
-
- test/app_root/app/controllers/
|
69
|
-
- test/app_root/app/controllers/
|
70
|
-
- test/app_root/app/controllers/payment/pay_pal/transactions_controller.rb
|
72
|
+
- test/app_root/app/controllers/application_controller.rb
|
73
|
+
- test/app_root/app/controllers/admin
|
71
74
|
- test/app_root/app/controllers/admin/users_controller.rb
|
72
|
-
- test/app_root/
|
73
|
-
- test/app_root/
|
74
|
-
- test/
|
75
|
-
- test/
|
76
|
-
-
|
77
|
-
- test/unit/has_roles_test.rb
|
78
|
-
- test/unit/controller_test.rb
|
79
|
-
- test/unit/authorization_helper_test.rb
|
80
|
-
- CHANGELOG
|
75
|
+
- test/app_root/app/controllers/admin/base_controller.rb
|
76
|
+
- test/app_root/app/controllers/users_controller.rb
|
77
|
+
- test/app_root/app/models
|
78
|
+
- test/app_root/app/models/user.rb
|
79
|
+
- CHANGELOG.rdoc
|
81
80
|
- init.rb
|
82
|
-
-
|
81
|
+
- LICENSE
|
83
82
|
- Rakefile
|
84
|
-
- README
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
- test/unit/role_assignment_test.rb
|
89
|
-
- test/unit/has_roles_test.rb
|
90
|
-
- test/unit/controller_test.rb
|
91
|
-
- test/unit/authorization_helper_test.rb
|
83
|
+
- README.rdoc
|
84
|
+
has_rdoc: true
|
85
|
+
homepage: http://www.pluginaweek.org
|
86
|
+
post_install_message:
|
92
87
|
rdoc_options: []
|
93
88
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: "0"
|
96
|
+
version:
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: "0"
|
102
|
+
version:
|
100
103
|
requirements: []
|
101
104
|
|
102
|
-
|
103
|
-
|
105
|
+
rubyforge_project: pluginaweek
|
106
|
+
rubygems_version: 1.3.1
|
107
|
+
signing_key:
|
108
|
+
specification_version: 2
|
109
|
+
summary: Demonstrates a reference implementation for handling role management
|
110
|
+
test_files:
|
111
|
+
- test/functional/has_roles_test.rb
|
112
|
+
- test/functional/application_controller_test.rb
|
113
|
+
- test/unit/role_test.rb
|
114
|
+
- test/unit/role_assignment_test.rb
|
115
|
+
- test/unit/role_permission_test.rb
|
116
|
+
- test/unit/permission_test.rb
|
117
|
+
- test/helpers/url_helper_test.rb
|
118
|
+
- test/helpers/authorization_helper_test.rb
|
data/CHANGELOG
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
*SVN*
|
2
|
-
|
3
|
-
*0.0.2* (September 26th, 2007)
|
4
|
-
|
5
|
-
* Fix role_assignments unique index having too long a name
|
6
|
-
|
7
|
-
* Add workaround for old sqlite versions that can't handle :distinct => true
|
8
|
-
|
9
|
-
*0.0.1* (September 5th, 2007)
|
10
|
-
|
11
|
-
* Add #role_ids and #role_ids=(new_ids) for models
|
12
|
-
|
13
|
-
* Added documentation
|
14
|
-
|
15
|
-
* Added helper methods for determining authorization within views
|
16
|
-
|
17
|
-
* Added unit tests
|
18
|
-
|
19
|
-
* Convert dos newlines to unix newlines
|