righter 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +28 -0
- data/app/models/righter_right.rb +75 -0
- data/app/models/righter_rights_righter_role.rb +4 -0
- data/app/models/righter_role.rb +82 -0
- data/app/models/righter_role_grant.rb +7 -0
- data/app/models/righter_roles_user.rb +2 -0
- data/db/migrate/20150910000000_create_righter_rights.rb +21 -0
- data/db/migrate/20150910000001_create_righter_roles.rb +20 -0
- data/db/migrate/20150910000002_righter_roles_righter_access_rights.rb +14 -0
- data/db/migrate/20150910000003_create_righter_roles_users.rb +14 -0
- data/lib/init.rb +1 -0
- data/lib/injections/righter_for_application_controller.rb +31 -0
- data/lib/injections/righter_for_resource.rb +110 -0
- data/lib/injections/righter_for_user.rb +186 -0
- data/lib/righter.rb +9 -0
- data/lib/righter/version.rb +3 -0
- data/lib/righter_error.rb +8 -0
- data/lib/tasks/righter_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +11 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +6 -0
- data/test/dummy/app/controllers/doors_controller.rb +23 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/door.rb +10 -0
- data/test/dummy/app/models/house.rb +7 -0
- data/test/dummy/app/models/player.rb +7 -0
- data/test/dummy/app/models/righter_roles_player.rb +2 -0
- data/test/dummy/app/models/user.rb +4 -0
- data/test/dummy/app/views/doors/show.html.erb +1 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +25 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +8 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/migrate/20150911000000_create_players.rb +18 -0
- data/test/dummy/db/migrate/20150911000002_create_users_table.rb +15 -0
- data/test/dummy/db/migrate/20150911000003_create_doors.rb +14 -0
- data/test/dummy/db/migrate/20150911000004_create_houses.rb +13 -0
- data/test/dummy/db/migrate/20150911000005_add_house_reference_to_doors.rb +9 -0
- data/test/dummy/db/schema.rb +90 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +35 -0
- data/test/dummy/log/test.log +117973 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0-mgT1BVDUIUlj7bJxvh7Ud3uSbC1DJf0Ok7Ehgieds.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9jPCqzZvmeFf31Rz8y3OEo8OQXEHVcwmLgkx0tXs-o8.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VTeG_7OBrkPzWFSh3MrTa0NSl2wOuJfTJ-XP7JqBG2w.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/a2CYO1s9hME5T1pntwZMB7J6dYjS0zCmDxw_7zX1T14.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/d71F8V8hdfF1jAttqkXKdizYR9PcM_zuKn_Lj_73gfE.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hCBjLjjeqhUCs4tdwCYlGcFA4xohMwurjmZx6OY1a7g.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +3 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ifgPguUzTOUeqB0zW0GV8DL6HEvPpakIWAzNPVuCGW0.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/j8yaH5wiyIN5a2xePYA_lQm39RgOQh27UiF5A7i6b28.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/o2kqwqoUQ3gkgncZO1IWdVRzFD0wCSQ-HyL62cINFOU.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pIwp2wi1sfaJlhiwzzvyyV0hKOihhYkP6709hRtpHxg.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pQIgTfLmEPykNamzxdqBww21SMT7YlZlZGy6hgQ6eVE.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/td9wUl9SLRnSSgE2ZK_VqCzLxTkFiCW50KkOhE916Wo.cache +1 -0
- data/test/factories/doors.rb +10 -0
- data/test/factories/houses.rb +7 -0
- data/test/factories/players.rb +6 -0
- data/test/factories/righter_rights.rb +11 -0
- data/test/factories/righter_roles.rb +9 -0
- data/test/factories/users.rb +9 -0
- data/test/fixtures/players.yml +6 -0
- data/test/fixtures/righter_rights.yml +21 -0
- data/test/fixtures/righter_roles.yml +29 -0
- data/test/fixtures/users.yml +27 -0
- data/test/functional/doors_controller_test.rb +71 -0
- data/test/righter_test.rb +9 -0
- data/test/test_helper.rb +54 -0
- data/test/unit/righter_for_resource_test.rb +137 -0
- data/test/unit/righter_right_test.rb +74 -0
- data/test/unit/righter_role_test.rb +197 -0
- data/test/unit/righter_user_test.rb +271 -0
- metadata +271 -0
@@ -0,0 +1,271 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class RighterUserTest < ActiveSupport::TestCase
|
4
|
+
fixtures :righter_rights, :righter_roles, :users, :players
|
5
|
+
|
6
|
+
def setup
|
7
|
+
RighterRight.clear_cache
|
8
|
+
end
|
9
|
+
|
10
|
+
test 'righter_accessible? :role checks if user has appropriate role' do
|
11
|
+
u = users :one
|
12
|
+
r = righter_roles(:secret_agent)
|
13
|
+
assert !u.righter_accessible?(role: :secret_agent)
|
14
|
+
u.add_role r
|
15
|
+
assert u.righter_accessible?(role: :secret_agent)
|
16
|
+
end
|
17
|
+
|
18
|
+
test 'righter_accessible? :right checks if user has appropriate right' do
|
19
|
+
u = users :one
|
20
|
+
r = righter_rights(:kill)
|
21
|
+
ro = righter_roles(:secret_agent)
|
22
|
+
ro.add_right r
|
23
|
+
|
24
|
+
assert !u.righter_accessible?(right: :kill)
|
25
|
+
u.add_role ro
|
26
|
+
assert u.reload.righter_accessible?(right: :kill)
|
27
|
+
end
|
28
|
+
|
29
|
+
test 'righter_accessible? :controller/:action checks if user has any role with :controller/:action' do
|
30
|
+
u = users :one
|
31
|
+
ro = righter_roles(:secret_agent)
|
32
|
+
right_to_kill = righter_rights(:kill)
|
33
|
+
ro.add_right right_to_kill
|
34
|
+
u.add_role ro
|
35
|
+
|
36
|
+
assert !u.reload.righter_accessible?(controller: :james, action: :bond)
|
37
|
+
right_to_kill.add_access_to controller: :james, actions: [:bond]
|
38
|
+
|
39
|
+
assert u.reload.righter_accessible?(controller: :james, action: :bond)
|
40
|
+
end
|
41
|
+
|
42
|
+
test 'righter_accessible? :controller/:action : wildcards are correctly expanded in action names' do
|
43
|
+
RighterRightsRighterRole.delete_all
|
44
|
+
RighterRolesUser.delete_all
|
45
|
+
r = righter_rights :kill
|
46
|
+
r.add_access_to controller: :villains, actions: [:'francisco_*']
|
47
|
+
u = users :one
|
48
|
+
role_secret_agent = righter_roles(:secret_agent)
|
49
|
+
u.add_role role_secret_agent
|
50
|
+
role_secret_agent.add_right r
|
51
|
+
|
52
|
+
assert u.reload.righter_accessible?(controller: :villains, action: :francisco_scaramanga)
|
53
|
+
assert !u.righter_accessible?(controller: :villains, action: :goldfinder)
|
54
|
+
|
55
|
+
r2 = righter_rights :vamp
|
56
|
+
role_bond_girl = righter_roles(:bond_girl)
|
57
|
+
role_bond_girl.add_right r2
|
58
|
+
u2 = users :two
|
59
|
+
u2.add_role role_bond_girl
|
60
|
+
r2.add_access_to controller: :men, actions: [:'*']
|
61
|
+
|
62
|
+
assert u2.reload.righter_accessible?(controller: :men, action: :any_man_in_the_world)
|
63
|
+
assert !u.reload.righter_accessible?(controller: :men, action: :any_man_in_the_world)
|
64
|
+
end
|
65
|
+
|
66
|
+
test 'righter_accessible?: namespace/controller/action works with wildcards' do
|
67
|
+
r = righter_rights :kill
|
68
|
+
role_secret_agent = righter_roles(:secret_agent)
|
69
|
+
role_secret_agent.add_right r
|
70
|
+
r.add_access_to controller: :'evil/world', actions: [:'make_*']
|
71
|
+
|
72
|
+
u = users :one
|
73
|
+
u.add_role role_secret_agent
|
74
|
+
|
75
|
+
assert u.reload.righter_accessible?(controller: :'evil/world', action: :make_peace)
|
76
|
+
end
|
77
|
+
|
78
|
+
test 'righter_accessible?: resource rights' do
|
79
|
+
admin_role = FactoryGirl.create(:righter_role, name: 'admin')
|
80
|
+
user_role = FactoryGirl.create(:righter_role, name: 'user')
|
81
|
+
door = FactoryGirl.create(:door) # this creates paint_Door_{id}, change_Door_{id}, open_Door_{id}
|
82
|
+
|
83
|
+
admin = FactoryGirl.create(:user)
|
84
|
+
admin.add_role admin_role
|
85
|
+
|
86
|
+
user = FactoryGirl.create(:user)
|
87
|
+
user.add_role user_role
|
88
|
+
|
89
|
+
guest = FactoryGirl.create(:user) # has no roles
|
90
|
+
|
91
|
+
assert_raises(RighterError) do
|
92
|
+
admin.reload.righter_accessible?(resource: door) # no right given
|
93
|
+
end
|
94
|
+
|
95
|
+
assert_raises(RighterError) do
|
96
|
+
admin.reload.righter_accessible?(resource: door, right: :unknown_right)
|
97
|
+
end
|
98
|
+
|
99
|
+
assert !admin.righter_accessible?(resource: door, right: :paint) # known right but without priviledge
|
100
|
+
assert admin.righter_accessible?(resource: door, right: :change)
|
101
|
+
assert admin.righter_accessible?(resource: door, right: :open)
|
102
|
+
|
103
|
+
assert !user.righter_accessible?(resource: door, right: :paint) # known right but without priviledge
|
104
|
+
assert !user.righter_accessible?(resource: door, right: :change) # known right but without priviledge
|
105
|
+
assert user.righter_accessible?(resource: door, right: :open)
|
106
|
+
|
107
|
+
assert !guest.righter_accessible?(resource: door, right: :paint) # known right but without priviledge
|
108
|
+
assert !guest.righter_accessible?(resource: door, right: :change) # known right but without priviledge
|
109
|
+
assert !guest.righter_accessible?(resource: door, right: :open)
|
110
|
+
end
|
111
|
+
|
112
|
+
test 'add_role/remove_role will raise error for non existing role' do
|
113
|
+
u = users :one
|
114
|
+
assert_raise RighterError do
|
115
|
+
u.add_role 'smth'
|
116
|
+
end
|
117
|
+
assert_raise RighterError do
|
118
|
+
u.remove_role 'smth2'
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
test 'remove_role will remove association between role and user but will keep the role' do
|
123
|
+
u = users :one
|
124
|
+
r = righter_roles :bond_girl
|
125
|
+
u.add_role r
|
126
|
+
assert u.righter_roles.include?(r)
|
127
|
+
|
128
|
+
assert_no_difference 'RighterRole.count', 'The role itself should not be deleted - only the association' do
|
129
|
+
u.remove_role r
|
130
|
+
assert !u.reload.righter_roles.include?(r)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
test 'association is removed when role is deleted' do
|
135
|
+
user = users :one
|
136
|
+
role = righter_roles :bond_girl
|
137
|
+
assert_difference 'RighterRolesUser.count', 1 do
|
138
|
+
user.add_role role
|
139
|
+
end
|
140
|
+
assert_equal 1, user.righter_roles.size
|
141
|
+
assert_difference 'RighterRolesUser.count', -1 do
|
142
|
+
role.destroy
|
143
|
+
end
|
144
|
+
assert_equal 0, user.reload.righter_roles.size
|
145
|
+
end
|
146
|
+
|
147
|
+
test 'delete user' do
|
148
|
+
u = users :one
|
149
|
+
assert_difference 'User.count', -1 do
|
150
|
+
u.destroy
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
test 'association is removed when user is deleted' do
|
155
|
+
u = users :one
|
156
|
+
r = righter_roles :bond_girl
|
157
|
+
assert_difference 'RighterRolesUser.count', 1 do
|
158
|
+
u.add_role r
|
159
|
+
end
|
160
|
+
assert_equal 1, r.users.size
|
161
|
+
assert_difference 'RighterRolesUser.count', -1 do
|
162
|
+
u.destroy
|
163
|
+
end
|
164
|
+
assert_equal 0, r.reload.users.size
|
165
|
+
end
|
166
|
+
|
167
|
+
test 'righter_accessible? :right will raise error if asking for non existing right' do
|
168
|
+
u = users :one
|
169
|
+
assert_raise RighterError do
|
170
|
+
u.righter_accessible? right: :nonexistingright
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
test 'update_roles_with_respect_to_grants takes care that user-role can be paired only according to role grants' do
|
175
|
+
judi_dench = users :one
|
176
|
+
roger_moore = users :two
|
177
|
+
olga_kurylenko = users :three
|
178
|
+
|
179
|
+
role_mi6_boss = righter_roles :one
|
180
|
+
role_secret_agent = righter_roles :secret_agent
|
181
|
+
role_bond_girl = righter_roles :bond_girl
|
182
|
+
|
183
|
+
RighterRolesUser.delete_all
|
184
|
+
RighterRoleGrant.delete_all
|
185
|
+
|
186
|
+
judi_dench.add_role role_mi6_boss
|
187
|
+
role_mi6_boss.allow_to_grant_role role_secret_agent
|
188
|
+
role_secret_agent.allow_to_grant_role role_bond_girl
|
189
|
+
|
190
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
191
|
+
assert_equal [], roger_moore.reload.righter_roles
|
192
|
+
assert_equal [], olga_kurylenko.reload.righter_roles
|
193
|
+
|
194
|
+
User.current_user = judi_dench
|
195
|
+
|
196
|
+
roger_moore.update_roles_with_respect_to_grants [role_secret_agent]
|
197
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
198
|
+
assert_equal [role_secret_agent], roger_moore.reload.righter_roles
|
199
|
+
assert_equal [], olga_kurylenko.reload.righter_roles
|
200
|
+
|
201
|
+
olga_kurylenko.update_roles_with_respect_to_grants [role_bond_girl]
|
202
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
203
|
+
assert_equal [role_secret_agent], roger_moore.reload.righter_roles
|
204
|
+
assert_equal [], olga_kurylenko.reload.righter_roles
|
205
|
+
|
206
|
+
User.current_user = roger_moore.reload
|
207
|
+
|
208
|
+
olga_kurylenko.update_roles_with_respect_to_grants [role_bond_girl]
|
209
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
210
|
+
assert_equal [role_secret_agent], roger_moore.reload.righter_roles
|
211
|
+
assert_equal [role_bond_girl], olga_kurylenko.reload.righter_roles
|
212
|
+
|
213
|
+
judi_dench.update_roles_with_respect_to_grants [role_secret_agent]
|
214
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
215
|
+
assert_equal [role_secret_agent], roger_moore.reload.righter_roles
|
216
|
+
assert_equal [role_bond_girl], olga_kurylenko.reload.righter_roles
|
217
|
+
|
218
|
+
User.current_user = olga_kurylenko.reload
|
219
|
+
|
220
|
+
judi_dench.update_roles_with_respect_to_grants [role_bond_girl]
|
221
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
222
|
+
assert_equal [role_secret_agent], roger_moore.reload.righter_roles
|
223
|
+
assert_equal [role_bond_girl], olga_kurylenko.reload.righter_roles
|
224
|
+
|
225
|
+
olga_kurylenko.update_roles_with_respect_to_grants [role_secret_agent]
|
226
|
+
assert_equal [role_mi6_boss], judi_dench.reload.righter_roles
|
227
|
+
assert_equal [role_secret_agent], roger_moore.reload.righter_roles
|
228
|
+
assert_equal [role_bond_girl], olga_kurylenko.reload.righter_roles
|
229
|
+
end
|
230
|
+
|
231
|
+
test 'righter_player_roles' do
|
232
|
+
assert_nil Player.reflections[:righter_roles]
|
233
|
+
assert_nil RighterRole.reflections[:players]
|
234
|
+
|
235
|
+
Player.send :include, RighterForUser
|
236
|
+
|
237
|
+
assert Player.reflections['righter_roles'], 'Player should have association with RighterRoles'
|
238
|
+
assert RighterRole.reflections['players'], 'RighterRoles should have association with Players'
|
239
|
+
|
240
|
+
batman = players :batman
|
241
|
+
r = righter_roles(:secret_agent)
|
242
|
+
assert !batman.righter_accessible?(role: :secret_agent)
|
243
|
+
batman.add_role r
|
244
|
+
assert batman.righter_accessible?(role: :secret_agent)
|
245
|
+
end
|
246
|
+
|
247
|
+
test 'can? method' do
|
248
|
+
admin_role = FactoryGirl.create(:righter_role, name: 'admin')
|
249
|
+
user_role = FactoryGirl.create(:righter_role, name: 'user')
|
250
|
+
user = FactoryGirl.create(:user, login: 'user')
|
251
|
+
admin = FactoryGirl.create(:user, login: 'admin')
|
252
|
+
|
253
|
+
user.add_role(user_role)
|
254
|
+
admin.add_role(admin_role)
|
255
|
+
|
256
|
+
door = FactoryGirl.create(:door)
|
257
|
+
|
258
|
+
# Door:
|
259
|
+
# auto_manage_righter_right :paint
|
260
|
+
# auto_manage_righter_right :change, {auto_associate_roles: [:admin]}
|
261
|
+
# auto_manage_righter_right :open, {auto_associate_roles: [:admin, :user]}
|
262
|
+
|
263
|
+
assert !user.can?(:paint, door)
|
264
|
+
assert !user.can?(:change, door)
|
265
|
+
assert user.can?(:open, door)
|
266
|
+
|
267
|
+
assert !admin.can?(:paint, door)
|
268
|
+
assert admin.can?(:change, door)
|
269
|
+
assert admin.can?(:open, door)
|
270
|
+
end
|
271
|
+
end
|
metadata
ADDED
@@ -0,0 +1,271 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: righter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Lieskovsky
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: coveralls
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: ''
|
56
|
+
email:
|
57
|
+
- adamliesko@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- MIT-LICENSE
|
63
|
+
- Rakefile
|
64
|
+
- app/models/righter_right.rb
|
65
|
+
- app/models/righter_rights_righter_role.rb
|
66
|
+
- app/models/righter_role.rb
|
67
|
+
- app/models/righter_role_grant.rb
|
68
|
+
- app/models/righter_roles_user.rb
|
69
|
+
- db/migrate/20150910000000_create_righter_rights.rb
|
70
|
+
- db/migrate/20150910000001_create_righter_roles.rb
|
71
|
+
- db/migrate/20150910000002_righter_roles_righter_access_rights.rb
|
72
|
+
- db/migrate/20150910000003_create_righter_roles_users.rb
|
73
|
+
- lib/init.rb
|
74
|
+
- lib/injections/righter_for_application_controller.rb
|
75
|
+
- lib/injections/righter_for_resource.rb
|
76
|
+
- lib/injections/righter_for_user.rb
|
77
|
+
- lib/righter.rb
|
78
|
+
- lib/righter/version.rb
|
79
|
+
- lib/righter_error.rb
|
80
|
+
- lib/tasks/righter_tasks.rake
|
81
|
+
- test/dummy/README.rdoc
|
82
|
+
- test/dummy/Rakefile
|
83
|
+
- test/dummy/app/assets/javascripts/application.js
|
84
|
+
- test/dummy/app/assets/stylesheets/application.css
|
85
|
+
- test/dummy/app/controllers/application_controller.rb
|
86
|
+
- test/dummy/app/controllers/doors_controller.rb
|
87
|
+
- test/dummy/app/helpers/application_helper.rb
|
88
|
+
- test/dummy/app/models/door.rb
|
89
|
+
- test/dummy/app/models/house.rb
|
90
|
+
- test/dummy/app/models/player.rb
|
91
|
+
- test/dummy/app/models/righter_roles_player.rb
|
92
|
+
- test/dummy/app/models/user.rb
|
93
|
+
- test/dummy/app/views/doors/show.html.erb
|
94
|
+
- test/dummy/app/views/layouts/application.html.erb
|
95
|
+
- test/dummy/bin/bundle
|
96
|
+
- test/dummy/bin/rails
|
97
|
+
- test/dummy/bin/rake
|
98
|
+
- test/dummy/bin/setup
|
99
|
+
- test/dummy/config.ru
|
100
|
+
- test/dummy/config/application.rb
|
101
|
+
- test/dummy/config/boot.rb
|
102
|
+
- test/dummy/config/database.yml
|
103
|
+
- test/dummy/config/environment.rb
|
104
|
+
- test/dummy/config/environments/development.rb
|
105
|
+
- test/dummy/config/environments/production.rb
|
106
|
+
- test/dummy/config/environments/test.rb
|
107
|
+
- test/dummy/config/initializers/assets.rb
|
108
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
109
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
110
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
111
|
+
- test/dummy/config/initializers/inflections.rb
|
112
|
+
- test/dummy/config/initializers/mime_types.rb
|
113
|
+
- test/dummy/config/initializers/session_store.rb
|
114
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
115
|
+
- test/dummy/config/locales/en.yml
|
116
|
+
- test/dummy/config/routes.rb
|
117
|
+
- test/dummy/config/secrets.yml
|
118
|
+
- test/dummy/db/migrate/20150911000000_create_players.rb
|
119
|
+
- test/dummy/db/migrate/20150911000002_create_users_table.rb
|
120
|
+
- test/dummy/db/migrate/20150911000003_create_doors.rb
|
121
|
+
- test/dummy/db/migrate/20150911000004_create_houses.rb
|
122
|
+
- test/dummy/db/migrate/20150911000005_add_house_reference_to_doors.rb
|
123
|
+
- test/dummy/db/schema.rb
|
124
|
+
- test/dummy/db/test.sqlite3
|
125
|
+
- test/dummy/log/development.log
|
126
|
+
- test/dummy/log/test.log
|
127
|
+
- test/dummy/public/404.html
|
128
|
+
- test/dummy/public/422.html
|
129
|
+
- test/dummy/public/500.html
|
130
|
+
- test/dummy/public/favicon.ico
|
131
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/0-mgT1BVDUIUlj7bJxvh7Ud3uSbC1DJf0Ok7Ehgieds.cache
|
132
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache
|
133
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/9jPCqzZvmeFf31Rz8y3OEo8OQXEHVcwmLgkx0tXs-o8.cache
|
134
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache
|
135
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/VTeG_7OBrkPzWFSh3MrTa0NSl2wOuJfTJ-XP7JqBG2w.cache
|
136
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/a2CYO1s9hME5T1pntwZMB7J6dYjS0zCmDxw_7zX1T14.cache
|
137
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/d71F8V8hdfF1jAttqkXKdizYR9PcM_zuKn_Lj_73gfE.cache
|
138
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/hCBjLjjeqhUCs4tdwCYlGcFA4xohMwurjmZx6OY1a7g.cache
|
139
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache
|
140
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/ifgPguUzTOUeqB0zW0GV8DL6HEvPpakIWAzNPVuCGW0.cache
|
141
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/j8yaH5wiyIN5a2xePYA_lQm39RgOQh27UiF5A7i6b28.cache
|
142
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/o2kqwqoUQ3gkgncZO1IWdVRzFD0wCSQ-HyL62cINFOU.cache
|
143
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache
|
144
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/pIwp2wi1sfaJlhiwzzvyyV0hKOihhYkP6709hRtpHxg.cache
|
145
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/pQIgTfLmEPykNamzxdqBww21SMT7YlZlZGy6hgQ6eVE.cache
|
146
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/td9wUl9SLRnSSgE2ZK_VqCzLxTkFiCW50KkOhE916Wo.cache
|
147
|
+
- test/factories/doors.rb
|
148
|
+
- test/factories/houses.rb
|
149
|
+
- test/factories/players.rb
|
150
|
+
- test/factories/righter_rights.rb
|
151
|
+
- test/factories/righter_roles.rb
|
152
|
+
- test/factories/users.rb
|
153
|
+
- test/fixtures/players.yml
|
154
|
+
- test/fixtures/righter_rights.yml
|
155
|
+
- test/fixtures/righter_roles.yml
|
156
|
+
- test/fixtures/users.yml
|
157
|
+
- test/functional/doors_controller_test.rb
|
158
|
+
- test/righter_test.rb
|
159
|
+
- test/test_helper.rb
|
160
|
+
- test/unit/righter_for_resource_test.rb
|
161
|
+
- test/unit/righter_right_test.rb
|
162
|
+
- test/unit/righter_role_test.rb
|
163
|
+
- test/unit/righter_user_test.rb
|
164
|
+
homepage: ''
|
165
|
+
licenses:
|
166
|
+
- MIT
|
167
|
+
metadata: {}
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
requirements: []
|
183
|
+
rubyforge_project:
|
184
|
+
rubygems_version: 2.4.8
|
185
|
+
signing_key:
|
186
|
+
specification_version: 4
|
187
|
+
summary: Role based authorization security engine for your user model and resources.
|
188
|
+
test_files:
|
189
|
+
- test/dummy/app/assets/javascripts/application.js
|
190
|
+
- test/dummy/app/assets/stylesheets/application.css
|
191
|
+
- test/dummy/app/controllers/application_controller.rb
|
192
|
+
- test/dummy/app/controllers/doors_controller.rb
|
193
|
+
- test/dummy/app/helpers/application_helper.rb
|
194
|
+
- test/dummy/app/models/door.rb
|
195
|
+
- test/dummy/app/models/house.rb
|
196
|
+
- test/dummy/app/models/player.rb
|
197
|
+
- test/dummy/app/models/righter_roles_player.rb
|
198
|
+
- test/dummy/app/models/user.rb
|
199
|
+
- test/dummy/app/views/doors/show.html.erb
|
200
|
+
- test/dummy/app/views/layouts/application.html.erb
|
201
|
+
- test/dummy/bin/bundle
|
202
|
+
- test/dummy/bin/rails
|
203
|
+
- test/dummy/bin/rake
|
204
|
+
- test/dummy/bin/setup
|
205
|
+
- test/dummy/config/application.rb
|
206
|
+
- test/dummy/config/boot.rb
|
207
|
+
- test/dummy/config/database.yml
|
208
|
+
- test/dummy/config/environment.rb
|
209
|
+
- test/dummy/config/environments/development.rb
|
210
|
+
- test/dummy/config/environments/production.rb
|
211
|
+
- test/dummy/config/environments/test.rb
|
212
|
+
- test/dummy/config/initializers/assets.rb
|
213
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
214
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
215
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
216
|
+
- test/dummy/config/initializers/inflections.rb
|
217
|
+
- test/dummy/config/initializers/mime_types.rb
|
218
|
+
- test/dummy/config/initializers/session_store.rb
|
219
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
220
|
+
- test/dummy/config/locales/en.yml
|
221
|
+
- test/dummy/config/routes.rb
|
222
|
+
- test/dummy/config/secrets.yml
|
223
|
+
- test/dummy/config.ru
|
224
|
+
- test/dummy/db/migrate/20150911000000_create_players.rb
|
225
|
+
- test/dummy/db/migrate/20150911000002_create_users_table.rb
|
226
|
+
- test/dummy/db/migrate/20150911000003_create_doors.rb
|
227
|
+
- test/dummy/db/migrate/20150911000004_create_houses.rb
|
228
|
+
- test/dummy/db/migrate/20150911000005_add_house_reference_to_doors.rb
|
229
|
+
- test/dummy/db/schema.rb
|
230
|
+
- test/dummy/db/test.sqlite3
|
231
|
+
- test/dummy/log/development.log
|
232
|
+
- test/dummy/log/test.log
|
233
|
+
- test/dummy/public/404.html
|
234
|
+
- test/dummy/public/422.html
|
235
|
+
- test/dummy/public/500.html
|
236
|
+
- test/dummy/public/favicon.ico
|
237
|
+
- test/dummy/Rakefile
|
238
|
+
- test/dummy/README.rdoc
|
239
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/0-mgT1BVDUIUlj7bJxvh7Ud3uSbC1DJf0Ok7Ehgieds.cache
|
240
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache
|
241
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/9jPCqzZvmeFf31Rz8y3OEo8OQXEHVcwmLgkx0tXs-o8.cache
|
242
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/a2CYO1s9hME5T1pntwZMB7J6dYjS0zCmDxw_7zX1T14.cache
|
243
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/d71F8V8hdfF1jAttqkXKdizYR9PcM_zuKn_Lj_73gfE.cache
|
244
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/hCBjLjjeqhUCs4tdwCYlGcFA4xohMwurjmZx6OY1a7g.cache
|
245
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache
|
246
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/ifgPguUzTOUeqB0zW0GV8DL6HEvPpakIWAzNPVuCGW0.cache
|
247
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/j8yaH5wiyIN5a2xePYA_lQm39RgOQh27UiF5A7i6b28.cache
|
248
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/o2kqwqoUQ3gkgncZO1IWdVRzFD0wCSQ-HyL62cINFOU.cache
|
249
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache
|
250
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache
|
251
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/pIwp2wi1sfaJlhiwzzvyyV0hKOihhYkP6709hRtpHxg.cache
|
252
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/pQIgTfLmEPykNamzxdqBww21SMT7YlZlZGy6hgQ6eVE.cache
|
253
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/td9wUl9SLRnSSgE2ZK_VqCzLxTkFiCW50KkOhE916Wo.cache
|
254
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/VTeG_7OBrkPzWFSh3MrTa0NSl2wOuJfTJ-XP7JqBG2w.cache
|
255
|
+
- test/factories/doors.rb
|
256
|
+
- test/factories/houses.rb
|
257
|
+
- test/factories/players.rb
|
258
|
+
- test/factories/righter_rights.rb
|
259
|
+
- test/factories/righter_roles.rb
|
260
|
+
- test/factories/users.rb
|
261
|
+
- test/fixtures/players.yml
|
262
|
+
- test/fixtures/righter_rights.yml
|
263
|
+
- test/fixtures/righter_roles.yml
|
264
|
+
- test/fixtures/users.yml
|
265
|
+
- test/functional/doors_controller_test.rb
|
266
|
+
- test/righter_test.rb
|
267
|
+
- test/test_helper.rb
|
268
|
+
- test/unit/righter_for_resource_test.rb
|
269
|
+
- test/unit/righter_right_test.rb
|
270
|
+
- test/unit/righter_role_test.rb
|
271
|
+
- test/unit/righter_user_test.rb
|