granted 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +20 -0
- data/Gemfile +30 -0
- data/Gemfile.lock +198 -0
- data/Guardfile +19 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +172 -0
- data/Rakefile +31 -0
- data/VERSION +1 -0
- data/console +27 -0
- data/granted.gemspec +146 -0
- data/lib/granted/db/migrations/create_grants.rb +19 -0
- data/lib/granted/grant_class_factory.rb +14 -0
- data/lib/granted/granter.rb +67 -0
- data/lib/granted/models/grant.rb +18 -0
- data/lib/granted/modules/for_granted.rb +81 -0
- data/lib/granted/modules/grantee.rb +18 -0
- data/lib/granted/tasks/granted_tasks.rake +16 -0
- data/lib/granted/tasks.rb +1 -0
- data/lib/granted/version.rb +3 -0
- data/lib/granted.rb +12 -0
- data/spec/dummy/.rspec +1 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +10 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/document.rb +7 -0
- data/spec/dummy/app/models/user.rb +5 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +65 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +27 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/20130805113508_create_user.rb +9 -0
- data/spec/dummy/db/migrate/20130805113515_create_document.rb +10 -0
- data/spec/dummy/db/migrate/20132406101010_create_grants.rb +19 -0
- data/spec/dummy/db/schema.rb +41 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/grant_class_factory_spec.rb +17 -0
- data/spec/models/grant_spec.rb +114 -0
- data/spec/spec_helper.rb +54 -0
- metadata +356 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'rspec/autorun'
|
6
|
+
require 'simplecov'
|
7
|
+
SimpleCov.start 'rails'
|
8
|
+
|
9
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
10
|
+
# in spec/support/ and its subdirectories.
|
11
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
# ## Mock Framework
|
15
|
+
#
|
16
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
17
|
+
#
|
18
|
+
# config.mock_with :mocha
|
19
|
+
# config.mock_with :flexmock
|
20
|
+
# config.mock_with :rr
|
21
|
+
|
22
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
23
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
24
|
+
|
25
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
26
|
+
# examples within a transaction, remove the following line or assign false
|
27
|
+
# instead of true.
|
28
|
+
config.use_transactional_fixtures = false
|
29
|
+
|
30
|
+
# If true, the base class of anonymous controllers will be inferred
|
31
|
+
# automatically. This will be the default behavior in future versions of
|
32
|
+
# rspec-rails.
|
33
|
+
config.infer_base_class_for_anonymous_controllers = false
|
34
|
+
|
35
|
+
# Run specs in random order to surface order dependencies. If you find an
|
36
|
+
# order dependency and want to debug it, you can fix the order by providing
|
37
|
+
# the seed, which is printed after each run.
|
38
|
+
# --seed 1234
|
39
|
+
# config.order = "random"
|
40
|
+
|
41
|
+
config.before(:suite) do
|
42
|
+
DatabaseCleaner.strategy = :transaction
|
43
|
+
DatabaseCleaner.clean_with :truncation
|
44
|
+
end
|
45
|
+
|
46
|
+
config.before(:each) do
|
47
|
+
DatabaseCleaner.start
|
48
|
+
end
|
49
|
+
|
50
|
+
config.after(:each) do
|
51
|
+
DatabaseCleaner.clean
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,356 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: granted
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jannis Hermanns
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
type: :runtime
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.14
|
22
|
+
none: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 3.2.14
|
28
|
+
none: false
|
29
|
+
prerelease: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: jeweler
|
32
|
+
type: :development
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
none: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
none: false
|
45
|
+
prerelease: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: guard-rspec
|
48
|
+
type: :development
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
none: false
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
none: false
|
61
|
+
prerelease: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
type: :development
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
none: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
none: false
|
77
|
+
prerelease: false
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec-rails
|
80
|
+
type: :development
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
none: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
none: false
|
93
|
+
prerelease: false
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: terminal-notifier-guard
|
96
|
+
type: :development
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
none: false
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
none: false
|
109
|
+
prerelease: false
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: guard-bundler
|
112
|
+
type: :development
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
none: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
none: false
|
125
|
+
prerelease: false
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: simplecov
|
128
|
+
type: :development
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
none: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
none: false
|
141
|
+
prerelease: false
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: database_cleaner
|
144
|
+
type: :development
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
none: false
|
151
|
+
version_requirements: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ! '>='
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
none: false
|
157
|
+
prerelease: false
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: mysql2
|
160
|
+
type: :development
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
none: false
|
167
|
+
version_requirements: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ! '>='
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
none: false
|
173
|
+
prerelease: false
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: debugger
|
176
|
+
type: :development
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
none: false
|
183
|
+
version_requirements: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ! '>='
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
none: false
|
189
|
+
prerelease: false
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: activerecord-postgresql-adapter
|
192
|
+
type: :development
|
193
|
+
requirement: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
none: false
|
199
|
+
version_requirements: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
none: false
|
205
|
+
prerelease: false
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
name: activerecord-jdbc-adapter
|
208
|
+
type: :development
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - ! '>='
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
none: false
|
215
|
+
version_requirements: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - ! '>='
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '0'
|
220
|
+
none: false
|
221
|
+
prerelease: false
|
222
|
+
- !ruby/object:Gem::Dependency
|
223
|
+
name: activerecord-jdbcpostgresql-adapter
|
224
|
+
type: :development
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ! '>='
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
none: false
|
231
|
+
version_requirements: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ! '>='
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '0'
|
236
|
+
none: false
|
237
|
+
prerelease: false
|
238
|
+
- !ruby/object:Gem::Dependency
|
239
|
+
name: activerecord-jdbcmysql-adapter
|
240
|
+
type: :development
|
241
|
+
requirement: !ruby/object:Gem::Requirement
|
242
|
+
requirements:
|
243
|
+
- - ! '>='
|
244
|
+
- !ruby/object:Gem::Version
|
245
|
+
version: '0'
|
246
|
+
none: false
|
247
|
+
version_requirements: !ruby/object:Gem::Requirement
|
248
|
+
requirements:
|
249
|
+
- - ! '>='
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
version: '0'
|
252
|
+
none: false
|
253
|
+
prerelease: false
|
254
|
+
description: Takes care of defining what actions one model is allowed to do with another
|
255
|
+
model.
|
256
|
+
email: jannis@gmail.com
|
257
|
+
executables: []
|
258
|
+
extensions: []
|
259
|
+
extra_rdoc_files:
|
260
|
+
- LICENSE.txt
|
261
|
+
- README.markdown
|
262
|
+
files:
|
263
|
+
- .document
|
264
|
+
- .ruby-gemset
|
265
|
+
- .ruby-version
|
266
|
+
- .travis.yml
|
267
|
+
- Gemfile
|
268
|
+
- Gemfile.lock
|
269
|
+
- Guardfile
|
270
|
+
- LICENSE.txt
|
271
|
+
- README.markdown
|
272
|
+
- Rakefile
|
273
|
+
- VERSION
|
274
|
+
- console
|
275
|
+
- granted.gemspec
|
276
|
+
- lib/granted.rb
|
277
|
+
- lib/granted/db/migrations/create_grants.rb
|
278
|
+
- lib/granted/grant_class_factory.rb
|
279
|
+
- lib/granted/granter.rb
|
280
|
+
- lib/granted/models/grant.rb
|
281
|
+
- lib/granted/modules/for_granted.rb
|
282
|
+
- lib/granted/modules/grantee.rb
|
283
|
+
- lib/granted/tasks.rb
|
284
|
+
- lib/granted/tasks/granted_tasks.rake
|
285
|
+
- lib/granted/version.rb
|
286
|
+
- spec/dummy/.rspec
|
287
|
+
- spec/dummy/README.rdoc
|
288
|
+
- spec/dummy/Rakefile
|
289
|
+
- spec/dummy/app/assets/javascripts/application.js
|
290
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
291
|
+
- spec/dummy/app/controllers/application_controller.rb
|
292
|
+
- spec/dummy/app/helpers/application_helper.rb
|
293
|
+
- spec/dummy/app/mailers/.gitkeep
|
294
|
+
- spec/dummy/app/models/.gitkeep
|
295
|
+
- spec/dummy/app/models/document.rb
|
296
|
+
- spec/dummy/app/models/user.rb
|
297
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
298
|
+
- spec/dummy/config.ru
|
299
|
+
- spec/dummy/config/application.rb
|
300
|
+
- spec/dummy/config/boot.rb
|
301
|
+
- spec/dummy/config/database.yml
|
302
|
+
- spec/dummy/config/environment.rb
|
303
|
+
- spec/dummy/config/environments/development.rb
|
304
|
+
- spec/dummy/config/environments/production.rb
|
305
|
+
- spec/dummy/config/environments/test.rb
|
306
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
307
|
+
- spec/dummy/config/initializers/inflections.rb
|
308
|
+
- spec/dummy/config/initializers/mime_types.rb
|
309
|
+
- spec/dummy/config/initializers/secret_token.rb
|
310
|
+
- spec/dummy/config/initializers/session_store.rb
|
311
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
312
|
+
- spec/dummy/config/locales/en.yml
|
313
|
+
- spec/dummy/config/routes.rb
|
314
|
+
- spec/dummy/db/migrate/20130805113508_create_user.rb
|
315
|
+
- spec/dummy/db/migrate/20130805113515_create_document.rb
|
316
|
+
- spec/dummy/db/migrate/20132406101010_create_grants.rb
|
317
|
+
- spec/dummy/db/schema.rb
|
318
|
+
- spec/dummy/lib/assets/.gitkeep
|
319
|
+
- spec/dummy/log/.gitkeep
|
320
|
+
- spec/dummy/public/404.html
|
321
|
+
- spec/dummy/public/422.html
|
322
|
+
- spec/dummy/public/500.html
|
323
|
+
- spec/dummy/public/favicon.ico
|
324
|
+
- spec/dummy/script/rails
|
325
|
+
- spec/grant_class_factory_spec.rb
|
326
|
+
- spec/models/grant_spec.rb
|
327
|
+
- spec/spec_helper.rb
|
328
|
+
homepage: http://github.com/jayniz/granted
|
329
|
+
licenses:
|
330
|
+
- MIT
|
331
|
+
post_install_message:
|
332
|
+
rdoc_options: []
|
333
|
+
require_paths:
|
334
|
+
- lib
|
335
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
336
|
+
requirements:
|
337
|
+
- - ! '>='
|
338
|
+
- !ruby/object:Gem::Version
|
339
|
+
segments:
|
340
|
+
- 0
|
341
|
+
hash: 3452521829699155962
|
342
|
+
version: '0'
|
343
|
+
none: false
|
344
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - ! '>='
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '0'
|
349
|
+
none: false
|
350
|
+
requirements: []
|
351
|
+
rubyforge_project:
|
352
|
+
rubygems_version: 1.8.25
|
353
|
+
signing_key:
|
354
|
+
specification_version: 3
|
355
|
+
summary: Grant or revoke access to your ActiveRecord models
|
356
|
+
test_files: []
|