acl9 2.1.0 → 3.2.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.
Files changed (52) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +3 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +27 -11
  5. data/Appraisals +13 -6
  6. data/Gemfile +0 -2
  7. data/Gemfile.lock +125 -112
  8. data/README.md +11 -4
  9. data/Rakefile +0 -2
  10. data/acl9.gemspec +1 -3
  11. data/gemfiles/.bundle/config +2 -0
  12. data/gemfiles/rails_5.0.gemfile +10 -0
  13. data/gemfiles/rails_5.1.gemfile +10 -0
  14. data/gemfiles/{rails_4.0.gemfile → rails_5.2.gemfile} +2 -4
  15. data/gemfiles/{rails_4.1.gemfile → rails_6.0.gemfile} +2 -4
  16. data/gemfiles/{rails_4.2.gemfile → rails_6.1.gemfile} +2 -4
  17. data/lib/acl9.rb +40 -0
  18. data/lib/acl9/controller_extensions.rb +1 -1
  19. data/lib/acl9/controller_extensions/dsl_base.rb +8 -7
  20. data/lib/acl9/controller_extensions/generators.rb +4 -35
  21. data/lib/acl9/model_extensions.rb +3 -3
  22. data/lib/acl9/model_extensions/for_subject.rb +52 -31
  23. data/lib/acl9/version.rb +1 -1
  24. data/lib/generators/acl9/setup/setup_generator.rb +10 -3
  25. data/lib/generators/acl9/setup/templates/create_role_tables.rb +10 -1
  26. data/lib/generators/acl9/setup/templates/role.rb +1 -1
  27. data/test/controller_extensions/actions_test.rb +1 -1
  28. data/test/controller_extensions/multiple_role_arguments_test.rb +11 -10
  29. data/test/controllers/acl_action_override_test.rb +4 -4
  30. data/test/controllers/acl_helper_method_test.rb +6 -3
  31. data/test/controllers/acl_ivars_test.rb +2 -2
  32. data/test/controllers/acl_object_hash_test.rb +1 -1
  33. data/test/controllers/acl_query_mixin.rb +5 -2
  34. data/test/controllers/acl_subject_method_test.rb +1 -1
  35. data/test/controllers/arguments_checking_test.rb +4 -4
  36. data/test/dummy/app/assets/config/manifest.js +0 -0
  37. data/test/dummy/app/controllers/acl_action_override.rb +5 -5
  38. data/test/dummy/app/controllers/acl_boolean_method.rb +6 -6
  39. data/test/dummy/app/controllers/acl_ivars.rb +3 -3
  40. data/test/dummy/app/controllers/acl_query_method_named.rb +2 -0
  41. data/test/dummy/app/controllers/application_controller.rb +6 -0
  42. data/test/dummy/app/controllers/empty_controller.rb +1 -1
  43. data/test/dummy/app/models/string_object_role.rb +3 -0
  44. data/test/dummy/app/models/string_user.rb +3 -0
  45. data/test/dummy/app/models/uuid.rb +1 -1
  46. data/test/dummy/config/environments/test.rb +2 -2
  47. data/test/dummy/config/routes.rb +12 -1
  48. data/test/dummy/db/migrate/20141117132218_create_tables.rb +68 -18
  49. data/test/models/roles_test.rb +13 -1
  50. data/test/test_helper.rb +31 -28
  51. metadata +26 -29
  52. data/test/dummy/config/environments/production.rb +0 -78
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d5f65e35d4e9298c14f5954b31b864aa8257d8ab
4
- data.tar.gz: 0b603fd3fcf803a503a1a3e8ac16244227e1c932
2
+ SHA256:
3
+ metadata.gz: 7c96a3e331bb553a202d5002bc13de3d6660fe417ff48c20174715dfdb09e96f
4
+ data.tar.gz: 105c1c70b580c5a7cd49105e04d6f6f4acba5c8182fedc9ea9995dcb83050e71
5
5
  SHA512:
6
- metadata.gz: 8bc88b6be0fd0bb9b189a5e004cb79a06b552d527f8f7f76627bb8fbc2a02fb1e44cd67a29d4fb9241f7633ded1445346149bb174ce47a2e850d14bdc5a086b9
7
- data.tar.gz: 21dee50ff08be47a3e2b07f101b2f348a73242917c12cbf6e461ba38ac86fc8826d05eddd3f054ce2ba302c8ccf692fdea99f4c390432f55dbbfdb7d4eea8237
6
+ metadata.gz: 5c79f61b3da512da237806b469f5f24051b9b845424be81d08b52188ab4597acb71aa4ecb5047d211701d8324d438c83996052a5bc243f333cf967bf1517bebc
7
+ data.tar.gz: 8a218af5d9e00f16c9d7e5162ad973c7386d1c4c4b8801c541bd767caccdfecfb9b85fa342dfcfa46c727e49ef17d1432c55761629994135c5ce7542b9fe8826
data/.gitignore CHANGED
@@ -19,3 +19,6 @@
19
19
 
20
20
  /doc
21
21
  /.yardoc
22
+
23
+ /acl9-*.gem
24
+ /gemfiles/*.lock
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.7.2
data/.travis.yml CHANGED
@@ -1,21 +1,37 @@
1
1
  cache: bundler
2
2
  language: ruby
3
3
  rvm:
4
- - 2.0.0
5
- - 2.1.6
6
- - 2.2.2
4
+ - 2.5.8
5
+ - 2.6.6
6
+ - 2.7.2
7
+ - 3.0.0
7
8
  - ruby-head
8
9
 
9
10
  gemfile:
10
- - gemfiles/rails_4.0.gemfile
11
- - gemfiles/rails_4.1.gemfile
12
- - gemfiles/rails_4.2.gemfile
11
+ - gemfiles/rails_5.0.gemfile
12
+ - gemfiles/rails_5.1.gemfile
13
+ - gemfiles/rails_5.2.gemfile
14
+ - gemfiles/rails_6.0.gemfile
15
+ - gemfiles/rails_6.1.gemfile
13
16
 
14
- matrix:
17
+ jobs:
15
18
  fast_finish: true
16
19
  allow_failures:
17
20
  - rvm: ruby-head
18
-
19
- addons:
20
- code_climate:
21
- repo_token: 6701faf591ff926cd9b3ea7f07c5e72984d2b1e26b33caba26114a6bfe859a11
21
+ exclude:
22
+ - rvm: 2.5.8
23
+ gemfile: gemfiles/rails_6.0.gemfile
24
+ - rvm: 2.5.8
25
+ gemfile: gemfiles/rails_6.1.gemfile
26
+ - rvm: 2.7.2
27
+ gemfile: gemfiles/rails_5.0.gemfile
28
+ - rvm: 2.7.2
29
+ gemfile: gemfiles/rails_5.1.gemfile
30
+ - rvm: 2.7.2
31
+ gemfile: gemfiles/rails_5.2.gemfile
32
+ - rvm: 3.0.0
33
+ gemfile: gemfiles/rails_5.0.gemfile
34
+ - rvm: 3.0.0
35
+ gemfile: gemfiles/rails_5.1.gemfile
36
+ - rvm: 3.0.0
37
+ gemfile: gemfiles/rails_5.2.gemfile
data/Appraisals CHANGED
@@ -1,12 +1,19 @@
1
- appraise "rails-4.0" do
2
- gem "rails", "~> 4.0.0"
1
+ appraise "rails-5.0" do
2
+ gem 'rails', '~> 5.0.0'
3
3
  end
4
4
 
5
- appraise "rails-4.1" do
6
- gem "rails", "~> 4.1.0"
5
+ appraise "rails-5.1" do
6
+ gem 'rails', '~> 5.1.0'
7
7
  end
8
8
 
9
- appraise "rails-4.2" do
10
- gem 'rails', '~> 4.2.0'
9
+ appraise "rails-5.2" do
10
+ gem 'rails', '~> 5.2.0'
11
11
  end
12
12
 
13
+ appraise "rails-6.0" do
14
+ gem 'rails', '~> 6.0.0'
15
+ end
16
+
17
+ appraise "rails-6.1" do
18
+ gem 'rails', '~> 6.1.0'
19
+ end
data/Gemfile CHANGED
@@ -4,6 +4,4 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem 'appraisal'
7
- gem 'tapout'
8
- gem 'minitap'
9
7
  gem 'byebug'
data/Gemfile.lock CHANGED
@@ -1,129 +1,142 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acl9 (2.1.0)
5
- rails (~> 4.0)
4
+ acl9 (3.1.0)
5
+ rails (> 5.0, < 7.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (4.2.1)
11
- actionpack (= 4.2.1)
12
- actionview (= 4.2.1)
13
- activejob (= 4.2.1)
10
+ actioncable (6.0.0)
11
+ actionpack (= 6.0.0)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailbox (6.0.0)
15
+ actionpack (= 6.0.0)
16
+ activejob (= 6.0.0)
17
+ activerecord (= 6.0.0)
18
+ activestorage (= 6.0.0)
19
+ activesupport (= 6.0.0)
20
+ mail (>= 2.7.1)
21
+ actionmailer (6.0.0)
22
+ actionpack (= 6.0.0)
23
+ actionview (= 6.0.0)
24
+ activejob (= 6.0.0)
14
25
  mail (~> 2.5, >= 2.5.4)
15
- rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.1)
17
- actionview (= 4.2.1)
18
- activesupport (= 4.2.1)
19
- rack (~> 1.6)
20
- rack-test (~> 0.6.2)
21
- rails-dom-testing (~> 1.0, >= 1.0.5)
22
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
23
- actionview (4.2.1)
24
- activesupport (= 4.2.1)
26
+ rails-dom-testing (~> 2.0)
27
+ actionpack (6.0.0)
28
+ actionview (= 6.0.0)
29
+ activesupport (= 6.0.0)
30
+ rack (~> 2.0)
31
+ rack-test (>= 0.6.3)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
+ actiontext (6.0.0)
35
+ actionpack (= 6.0.0)
36
+ activerecord (= 6.0.0)
37
+ activestorage (= 6.0.0)
38
+ activesupport (= 6.0.0)
39
+ nokogiri (>= 1.8.5)
40
+ actionview (6.0.0)
41
+ activesupport (= 6.0.0)
25
42
  builder (~> 3.1)
26
- erubis (~> 2.7.0)
27
- rails-dom-testing (~> 1.0, >= 1.0.5)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
29
- activejob (4.2.1)
30
- activesupport (= 4.2.1)
31
- globalid (>= 0.3.0)
32
- activemodel (4.2.1)
33
- activesupport (= 4.2.1)
34
- builder (~> 3.1)
35
- activerecord (4.2.1)
36
- activemodel (= 4.2.1)
37
- activesupport (= 4.2.1)
38
- arel (~> 6.0)
39
- activesupport (4.2.1)
40
- i18n (~> 0.7)
41
- json (~> 1.7, >= 1.7.7)
43
+ erubi (~> 1.4)
44
+ rails-dom-testing (~> 2.0)
45
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
+ activejob (6.0.0)
47
+ activesupport (= 6.0.0)
48
+ globalid (>= 0.3.6)
49
+ activemodel (6.0.0)
50
+ activesupport (= 6.0.0)
51
+ activerecord (6.0.0)
52
+ activemodel (= 6.0.0)
53
+ activesupport (= 6.0.0)
54
+ activestorage (6.0.0)
55
+ actionpack (= 6.0.0)
56
+ activejob (= 6.0.0)
57
+ activerecord (= 6.0.0)
58
+ marcel (~> 0.3.1)
59
+ activesupport (6.0.0)
60
+ concurrent-ruby (~> 1.0, >= 1.0.2)
61
+ i18n (>= 0.7, < 2)
42
62
  minitest (~> 5.1)
43
- thread_safe (~> 0.3, >= 0.3.4)
44
63
  tzinfo (~> 1.1)
45
- ansi (1.5.0)
46
- appraisal (1.0.2)
64
+ zeitwerk (~> 2.1, >= 2.1.8)
65
+ appraisal (2.2.0)
47
66
  bundler
48
67
  rake
49
68
  thor (>= 0.14.0)
50
- arel (6.0.0)
51
- builder (3.2.2)
52
- byebug (4.0.5)
53
- columnize (= 0.9.0)
54
- codeclimate-test-reporter (0.4.1)
55
- simplecov (>= 0.7.1, < 1.0.0)
56
- columnize (0.9.0)
57
- docile (1.1.5)
58
- erubis (2.7.0)
59
- globalid (0.3.5)
60
- activesupport (>= 4.1.0)
61
- i18n (0.7.0)
62
- json (1.8.1)
63
- loofah (2.0.2)
69
+ builder (3.2.3)
70
+ byebug (11.0.1)
71
+ concurrent-ruby (1.1.5)
72
+ crass (1.0.4)
73
+ erubi (1.8.0)
74
+ globalid (0.4.2)
75
+ activesupport (>= 4.2.0)
76
+ i18n (1.6.0)
77
+ concurrent-ruby (~> 1.0)
78
+ loofah (2.2.3)
79
+ crass (~> 1.0.2)
64
80
  nokogiri (>= 1.5.9)
65
- mail (2.6.3)
66
- mime-types (>= 1.16, < 3)
67
- mime-types (2.5)
68
- mini_portile (0.6.2)
69
- minitap (0.5.3)
70
- minitest (~> 5.0)
71
- minitest-reporter-api (>= 0.0.2)
72
- tapout (>= 0.3.0)
73
- minitest (5.5.0)
74
- minitest-reporter-api (0.0.5)
75
- minitest (~> 5.0)
76
- multi_json (1.10.1)
77
- nokogiri (1.6.6.2)
78
- mini_portile (~> 0.6.0)
79
- rack (1.6.1)
80
- rack-test (0.6.3)
81
- rack (>= 1.0)
82
- rails (4.2.1)
83
- actionmailer (= 4.2.1)
84
- actionpack (= 4.2.1)
85
- actionview (= 4.2.1)
86
- activejob (= 4.2.1)
87
- activemodel (= 4.2.1)
88
- activerecord (= 4.2.1)
89
- activesupport (= 4.2.1)
90
- bundler (>= 1.3.0, < 2.0)
91
- railties (= 4.2.1)
92
- sprockets-rails
93
- rails-deprecated_sanitizer (1.0.3)
94
- activesupport (>= 4.2.0.alpha)
95
- rails-dom-testing (1.0.6)
96
- activesupport (>= 4.2.0.beta, < 5.0)
97
- nokogiri (~> 1.6.0)
98
- rails-deprecated_sanitizer (>= 1.0.1)
99
- rails-html-sanitizer (1.0.2)
100
- loofah (~> 2.0)
101
- railties (4.2.1)
102
- actionpack (= 4.2.1)
103
- activesupport (= 4.2.1)
81
+ mail (2.7.1)
82
+ mini_mime (>= 0.1.1)
83
+ marcel (0.3.3)
84
+ mimemagic (~> 0.3.2)
85
+ method_source (0.9.2)
86
+ mimemagic (0.3.3)
87
+ mini_mime (1.0.2)
88
+ mini_portile2 (2.4.0)
89
+ minitest (5.11.3)
90
+ nio4r (2.5.1)
91
+ nokogiri (1.10.4)
92
+ mini_portile2 (~> 2.4.0)
93
+ rack (2.0.7)
94
+ rack-test (1.1.0)
95
+ rack (>= 1.0, < 3)
96
+ rails (6.0.0)
97
+ actioncable (= 6.0.0)
98
+ actionmailbox (= 6.0.0)
99
+ actionmailer (= 6.0.0)
100
+ actionpack (= 6.0.0)
101
+ actiontext (= 6.0.0)
102
+ actionview (= 6.0.0)
103
+ activejob (= 6.0.0)
104
+ activemodel (= 6.0.0)
105
+ activerecord (= 6.0.0)
106
+ activestorage (= 6.0.0)
107
+ activesupport (= 6.0.0)
108
+ bundler (>= 1.3.0)
109
+ railties (= 6.0.0)
110
+ sprockets-rails (>= 2.0.0)
111
+ rails-dom-testing (2.0.3)
112
+ activesupport (>= 4.2.0)
113
+ nokogiri (>= 1.6)
114
+ rails-html-sanitizer (1.2.0)
115
+ loofah (~> 2.2, >= 2.2.2)
116
+ railties (6.0.0)
117
+ actionpack (= 6.0.0)
118
+ activesupport (= 6.0.0)
119
+ method_source
104
120
  rake (>= 0.8.7)
105
- thor (>= 0.18.1, < 2.0)
106
- rake (10.4.2)
107
- simplecov (0.9.1)
108
- docile (~> 1.1.0)
109
- multi_json (~> 1.0)
110
- simplecov-html (~> 0.8.0)
111
- simplecov-html (0.8.0)
112
- sprockets (3.1.0)
113
- rack (~> 1.0)
114
- sprockets-rails (2.3.1)
115
- actionpack (>= 3.0)
116
- activesupport (>= 3.0)
117
- sprockets (>= 2.8, < 4.0)
118
- sqlite3 (1.3.10)
119
- tapout (0.4.5)
120
- ansi
121
- json
122
- thor (0.19.1)
123
- thread_safe (0.3.5)
124
- tzinfo (1.2.2)
121
+ thor (>= 0.20.3, < 2.0)
122
+ rake (12.3.3)
123
+ sprockets (3.7.2)
124
+ concurrent-ruby (~> 1.0)
125
+ rack (> 1, < 3)
126
+ sprockets-rails (3.2.1)
127
+ actionpack (>= 4.0)
128
+ activesupport (>= 4.0)
129
+ sprockets (>= 3.0.0)
130
+ sqlite3 (1.4.1)
131
+ thor (0.20.3)
132
+ thread_safe (0.3.6)
133
+ tzinfo (1.2.5)
125
134
  thread_safe (~> 0.1)
126
- yard (0.8.7.6)
135
+ websocket-driver (0.7.1)
136
+ websocket-extensions (>= 0.1.0)
137
+ websocket-extensions (0.1.4)
138
+ yard (0.9.20)
139
+ zeitwerk (2.1.10)
127
140
 
128
141
  PLATFORMS
129
142
  ruby
@@ -132,8 +145,8 @@ DEPENDENCIES
132
145
  acl9!
133
146
  appraisal
134
147
  byebug
135
- codeclimate-test-reporter
136
- minitap
137
148
  sqlite3
138
- tapout
139
149
  yard
150
+
151
+ BUNDLED WITH
152
+ 2.2.10
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # acl9
2
2
 
3
- [![Travis-CI](https://travis-ci.org/be9/acl9.svg?branch=master)](https://travis-ci.org/be9/acl9) [![Code Climate](https://codeclimate.com/github/be9/acl9/badges/gpa.svg)](https://codeclimate.com/github/be9/acl9) [![Test Coverage](https://codeclimate.com/github/be9/acl9/badges/coverage.svg)](https://codeclimate.com/github/be9/acl9)
3
+ [![Travis-CI](https://travis-ci.org/be9/acl9.svg?branch=master)](https://travis-ci.org/be9/acl9)
4
4
 
5
5
  Acl9 is a role-based authorization system that provides a concise DSL for
6
6
  securing your Rails application.
@@ -15,11 +15,19 @@ permissions correct.
15
15
  Acl9 is [Semantically Versioned](http://semver.org/), so just add this to your
16
16
  `Gemfile`:
17
17
 
18
+ ```ruby
19
+ gem 'acl9', '~> 3.2'
20
+ ```
21
+
22
+ You will need Ruby > 2.0
23
+
24
+ ### Rails 4 - stick with 2.x
25
+
18
26
  ```ruby
19
27
  gem 'acl9', '~> 2.0'
20
28
  ```
21
29
 
22
- You will need Ruby 2.x
30
+ ### Rails < 4 - upgrade Rails!
23
31
 
24
32
  We dropped support for Rails < 4 in the 1.x releases, so if you're still using
25
33
  Rails 2.x or 3.x then you'll want this:
@@ -289,8 +297,7 @@ doing things that they think are going to work but actually aren't like:
289
297
 
290
298
  ## Community
291
299
 
292
- **IRC:** Please drop in for a chat on #acl9 on Freenode, [use
293
- this](http://webchat.freenode.net/) if you have no other option.
300
+ **Gitter:** [Join the gitter chat here](https://gitter.im/be9/acl9)
294
301
 
295
302
  **docs:** Rdocs are available [here](http://rdoc.info/projects/be9/acl9).
296
303
 
data/Rakefile CHANGED
@@ -10,8 +10,6 @@ require 'rake/testtask'
10
10
  Rake::TestTask.new(:test) do |test|
11
11
  test.libs << 'lib' << 'test'
12
12
  test.pattern = 'test/**/*_test.rb'
13
- test.verbose = false
14
- test.options = " | tapout runtime"
15
13
  end
16
14
 
17
15
  require 'yard'
data/acl9.gemspec CHANGED
@@ -20,10 +20,8 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.rdoc_options = ["--charset=UTF-8"]
22
22
 
23
- s.add_dependency "rails", '~> 4.0'
23
+ s.add_dependency "rails", '>= 5.0', '< 7.0'
24
24
 
25
- s.add_development_dependency "codeclimate-test-reporter"
26
25
  s.add_development_dependency "yard"
27
26
  s.add_development_dependency 'sqlite3'
28
27
  end
29
-
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "byebug"
7
+ gem "rails", "~> 5.0.0"
8
+ gem "sqlite3", "~> 1.3.6", :group => :development
9
+
10
+ gemspec path: "../"