cancancan 1.15.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/cancancan.gemspec +18 -18
  3. data/init.rb +2 -0
  4. data/lib/cancan.rb +9 -11
  5. data/lib/cancan/ability.rb +90 -203
  6. data/lib/cancan/ability/actions.rb +93 -0
  7. data/lib/cancan/ability/rules.rb +93 -0
  8. data/lib/cancan/ability/strong_parameter_support.rb +41 -0
  9. data/lib/cancan/conditions_matcher.rb +106 -0
  10. data/lib/cancan/controller_additions.rb +29 -36
  11. data/lib/cancan/controller_resource.rb +46 -211
  12. data/lib/cancan/controller_resource_builder.rb +26 -0
  13. data/lib/cancan/controller_resource_finder.rb +42 -0
  14. data/lib/cancan/controller_resource_loader.rb +120 -0
  15. data/lib/cancan/controller_resource_name_finder.rb +23 -0
  16. data/lib/cancan/controller_resource_sanitizer.rb +32 -0
  17. data/lib/cancan/exceptions.rb +17 -5
  18. data/lib/cancan/matchers.rb +12 -3
  19. data/lib/cancan/model_adapters/abstract_adapter.rb +10 -8
  20. data/lib/cancan/model_adapters/active_record_4_adapter.rb +39 -43
  21. data/lib/cancan/model_adapters/active_record_5_adapter.rb +68 -0
  22. data/lib/cancan/model_adapters/active_record_adapter.rb +77 -82
  23. data/lib/cancan/model_adapters/conditions_extractor.rb +75 -0
  24. data/lib/cancan/model_adapters/conditions_normalizer.rb +49 -0
  25. data/lib/cancan/model_adapters/default_adapter.rb +2 -0
  26. data/lib/cancan/model_additions.rb +2 -1
  27. data/lib/cancan/parameter_validators.rb +9 -0
  28. data/lib/cancan/relevant.rb +29 -0
  29. data/lib/cancan/rule.rb +76 -106
  30. data/lib/cancan/rules_compressor.rb +23 -0
  31. data/lib/cancan/unauthorized_message_resolver.rb +24 -0
  32. data/lib/cancan/version.rb +3 -1
  33. data/lib/cancancan.rb +2 -0
  34. data/lib/generators/cancan/ability/ability_generator.rb +4 -2
  35. data/lib/generators/cancan/ability/templates/ability.rb +2 -0
  36. metadata +66 -57
  37. data/.gitignore +0 -15
  38. data/.rspec +0 -1
  39. data/.travis.yml +0 -33
  40. data/Appraisals +0 -104
  41. data/CHANGELOG.rdoc +0 -527
  42. data/CONTRIBUTING.md +0 -23
  43. data/Gemfile +0 -3
  44. data/LICENSE +0 -22
  45. data/README.md +0 -217
  46. data/Rakefile +0 -9
  47. data/gemfiles/activerecord_3.2.gemfile +0 -17
  48. data/gemfiles/activerecord_4.0.gemfile +0 -18
  49. data/gemfiles/activerecord_4.1.gemfile +0 -18
  50. data/gemfiles/activerecord_4.2.gemfile +0 -19
  51. data/gemfiles/activerecord_5.0.gemfile +0 -19
  52. data/gemfiles/mongoid_2.x.gemfile +0 -17
  53. data/gemfiles/sequel_3.x.gemfile +0 -17
  54. data/lib/cancan/inherited_resource.rb +0 -20
  55. data/lib/cancan/model_adapters/active_record_3_adapter.rb +0 -16
  56. data/lib/cancan/model_adapters/mongoid_adapter.rb +0 -75
  57. data/lib/cancan/model_adapters/sequel_adapter.rb +0 -87
  58. data/spec/README.rdoc +0 -27
  59. data/spec/cancan/ability_spec.rb +0 -544
  60. data/spec/cancan/controller_additions_spec.rb +0 -151
  61. data/spec/cancan/controller_resource_spec.rb +0 -643
  62. data/spec/cancan/exceptions_spec.rb +0 -58
  63. data/spec/cancan/inherited_resource_spec.rb +0 -71
  64. data/spec/cancan/matchers_spec.rb +0 -29
  65. data/spec/cancan/model_adapters/active_record_4_adapter_spec.rb +0 -154
  66. data/spec/cancan/model_adapters/active_record_adapter_spec.rb +0 -405
  67. data/spec/cancan/model_adapters/default_adapter_spec.rb +0 -7
  68. data/spec/cancan/model_adapters/mongoid_adapter_spec.rb +0 -247
  69. data/spec/cancan/model_adapters/sequel_adapter_spec.rb +0 -132
  70. data/spec/cancan/rule_spec.rb +0 -52
  71. data/spec/matchers.rb +0 -13
  72. data/spec/spec.opts +0 -2
  73. data/spec/spec_helper.rb +0 -27
  74. data/spec/support/ability.rb +0 -7
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CanCan
2
- VERSION = "1.15.0"
4
+ VERSION = '3.1.0'.freeze
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cancan'
2
4
 
3
5
  module CanCanCan
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Cancan
2
4
  module Generators
3
5
  class AbilityGenerator < Rails::Generators::Base
4
- source_root File.expand_path('../templates', __FILE__)
6
+ source_root File.expand_path('templates', __dir__)
5
7
 
6
8
  def generate_ability
7
- copy_file "ability.rb", "app/models/ability.rb"
9
+ copy_file 'ability.rb', 'app/models/ability.rb'
8
10
  end
9
11
  end
10
12
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Ability
2
4
  include CanCan::Ability
3
5
 
metadata CHANGED
@@ -1,36 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancancan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
+ - Alessandro Rodi (Renuo AG)
7
8
  - Bryan Rite
8
9
  - Ryan Bates
9
10
  - Richard Wilson
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2016-06-13 00:00:00.000000000 Z
14
+ date: 2020-03-15 00:00:00.000000000 Z
14
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: appraisal
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.0
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '2.0'
26
+ type: :development
27
+ prerelease: false
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.0
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '2.0'
15
36
  - !ruby/object:Gem::Dependency
16
37
  name: bundler
17
38
  requirement: !ruby/object:Gem::Requirement
18
39
  requirements:
19
40
  - - "~>"
20
41
  - !ruby/object:Gem::Version
21
- version: '1.3'
42
+ version: '2.0'
22
43
  type: :development
23
44
  prerelease: false
24
45
  version_requirements: !ruby/object:Gem::Requirement
25
46
  requirements:
26
47
  - - "~>"
27
48
  - !ruby/object:Gem::Version
28
- version: '1.3'
49
+ version: '2.0'
29
50
  - !ruby/object:Gem::Dependency
30
51
  name: rake
31
52
  requirement: !ruby/object:Gem::Requirement
32
53
  requirements:
33
54
  - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '10.1'
57
+ - - ">="
34
58
  - !ruby/object:Gem::Version
35
59
  version: 10.1.1
36
60
  type: :development
@@ -38,100 +62,87 @@ dependencies:
38
62
  version_requirements: !ruby/object:Gem::Requirement
39
63
  requirements:
40
64
  - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '10.1'
67
+ - - ">="
41
68
  - !ruby/object:Gem::Version
42
69
  version: 10.1.1
43
70
  - !ruby/object:Gem::Dependency
44
71
  name: rspec
45
72
  requirement: !ruby/object:Gem::Requirement
46
73
  requirements:
47
- - - "~>"
74
+ - - ">="
48
75
  - !ruby/object:Gem::Version
49
76
  version: 3.2.0
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '3.2'
50
80
  type: :development
51
81
  prerelease: false
52
82
  version_requirements: !ruby/object:Gem::Requirement
53
83
  requirements:
54
- - - "~>"
84
+ - - ">="
55
85
  - !ruby/object:Gem::Version
56
86
  version: 3.2.0
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.2'
57
90
  - !ruby/object:Gem::Dependency
58
- name: appraisal
91
+ name: rubocop
59
92
  requirement: !ruby/object:Gem::Requirement
60
93
  requirements:
61
- - - ">="
94
+ - - "~>"
62
95
  - !ruby/object:Gem::Version
63
- version: 2.0.0
96
+ version: 0.63.1
64
97
  type: :development
65
98
  prerelease: false
66
99
  version_requirements: !ruby/object:Gem::Requirement
67
100
  requirements:
68
- - - ">="
101
+ - - "~>"
69
102
  - !ruby/object:Gem::Version
70
- version: 2.0.0
71
- description: Continuation of the simple authorization solution for Rails which is
72
- decoupled from user roles. All permissions are stored in a single location.
73
- email: r.crawfordwilson@gmail.com
103
+ version: 0.63.1
104
+ description: Simple authorization solution for Rails. All permissions are stored in
105
+ a single location.
106
+ email: alessandro.rodi@renuo.ch
74
107
  executables: []
75
108
  extensions: []
76
109
  extra_rdoc_files: []
77
110
  files:
78
- - ".gitignore"
79
- - ".rspec"
80
- - ".travis.yml"
81
- - Appraisals
82
- - CHANGELOG.rdoc
83
- - CONTRIBUTING.md
84
- - Gemfile
85
- - LICENSE
86
- - README.md
87
- - Rakefile
88
111
  - cancancan.gemspec
89
- - gemfiles/activerecord_3.2.gemfile
90
- - gemfiles/activerecord_4.0.gemfile
91
- - gemfiles/activerecord_4.1.gemfile
92
- - gemfiles/activerecord_4.2.gemfile
93
- - gemfiles/activerecord_5.0.gemfile
94
- - gemfiles/mongoid_2.x.gemfile
95
- - gemfiles/sequel_3.x.gemfile
96
112
  - init.rb
97
113
  - lib/cancan.rb
98
114
  - lib/cancan/ability.rb
115
+ - lib/cancan/ability/actions.rb
116
+ - lib/cancan/ability/rules.rb
117
+ - lib/cancan/ability/strong_parameter_support.rb
118
+ - lib/cancan/conditions_matcher.rb
99
119
  - lib/cancan/controller_additions.rb
100
120
  - lib/cancan/controller_resource.rb
121
+ - lib/cancan/controller_resource_builder.rb
122
+ - lib/cancan/controller_resource_finder.rb
123
+ - lib/cancan/controller_resource_loader.rb
124
+ - lib/cancan/controller_resource_name_finder.rb
125
+ - lib/cancan/controller_resource_sanitizer.rb
101
126
  - lib/cancan/exceptions.rb
102
- - lib/cancan/inherited_resource.rb
103
127
  - lib/cancan/matchers.rb
104
128
  - lib/cancan/model_adapters/abstract_adapter.rb
105
- - lib/cancan/model_adapters/active_record_3_adapter.rb
106
129
  - lib/cancan/model_adapters/active_record_4_adapter.rb
130
+ - lib/cancan/model_adapters/active_record_5_adapter.rb
107
131
  - lib/cancan/model_adapters/active_record_adapter.rb
132
+ - lib/cancan/model_adapters/conditions_extractor.rb
133
+ - lib/cancan/model_adapters/conditions_normalizer.rb
108
134
  - lib/cancan/model_adapters/default_adapter.rb
109
- - lib/cancan/model_adapters/mongoid_adapter.rb
110
- - lib/cancan/model_adapters/sequel_adapter.rb
111
135
  - lib/cancan/model_additions.rb
136
+ - lib/cancan/parameter_validators.rb
137
+ - lib/cancan/relevant.rb
112
138
  - lib/cancan/rule.rb
139
+ - lib/cancan/rules_compressor.rb
140
+ - lib/cancan/unauthorized_message_resolver.rb
113
141
  - lib/cancan/version.rb
114
142
  - lib/cancancan.rb
115
143
  - lib/generators/cancan/ability/USAGE
116
144
  - lib/generators/cancan/ability/ability_generator.rb
117
145
  - lib/generators/cancan/ability/templates/ability.rb
118
- - spec/README.rdoc
119
- - spec/cancan/ability_spec.rb
120
- - spec/cancan/controller_additions_spec.rb
121
- - spec/cancan/controller_resource_spec.rb
122
- - spec/cancan/exceptions_spec.rb
123
- - spec/cancan/inherited_resource_spec.rb
124
- - spec/cancan/matchers_spec.rb
125
- - spec/cancan/model_adapters/active_record_4_adapter_spec.rb
126
- - spec/cancan/model_adapters/active_record_adapter_spec.rb
127
- - spec/cancan/model_adapters/default_adapter_spec.rb
128
- - spec/cancan/model_adapters/mongoid_adapter_spec.rb
129
- - spec/cancan/model_adapters/sequel_adapter_spec.rb
130
- - spec/cancan/rule_spec.rb
131
- - spec/matchers.rb
132
- - spec/spec.opts
133
- - spec/spec_helper.rb
134
- - spec/support/ability.rb
135
146
  homepage: https://github.com/CanCanCommunity/cancancan
136
147
  licenses:
137
148
  - MIT
@@ -144,17 +155,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
155
  requirements:
145
156
  - - ">="
146
157
  - !ruby/object:Gem::Version
147
- version: 2.0.0
158
+ version: 2.2.0
148
159
  required_rubygems_version: !ruby/object:Gem::Requirement
149
160
  requirements:
150
161
  - - ">="
151
162
  - !ruby/object:Gem::Version
152
163
  version: '0'
153
164
  requirements: []
154
- rubyforge_project:
155
- rubygems_version: 2.4.5.1
165
+ rubygems_version: 3.0.6
156
166
  signing_key:
157
167
  specification_version: 4
158
168
  summary: Simple authorization solution for Rails.
159
- test_files:
160
- - Appraisals
169
+ test_files: []
data/.gitignore DELETED
@@ -1,15 +0,0 @@
1
- .DS_Store
2
- .idea/*
3
- *.swp
4
- **/*.swp
5
- *.gem
6
- .bundle
7
-
8
- gemfiles/*.lock
9
- Gemfile.lock
10
-
11
- .rvmrc
12
- .rbenv-version
13
- .ruby-version
14
- .ruby-gemset
15
- /tmp
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
@@ -1,33 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- sudo: false
4
- rvm:
5
- - 2.0.0
6
- - 2.1.0
7
- - 2.2.0
8
- - 2.2.2
9
- - jruby-9.0.5.0
10
- gemfile:
11
- - gemfiles/activerecord_3.2.gemfile
12
- - gemfiles/activerecord_4.0.gemfile
13
- - gemfiles/activerecord_4.1.gemfile
14
- - gemfiles/activerecord_4.2.gemfile
15
- - gemfiles/activerecord_5.0.gemfile
16
- - gemfiles/mongoid_2.x.gemfile
17
- - gemfiles/sequel_3.x.gemfile
18
- services:
19
- - mongodb
20
- matrix:
21
- fast_finish: true
22
- exclude:
23
- - rvm: 2.0.0
24
- gemfile: gemfiles/activerecord_5.0.gemfile
25
- - rvm: 2.1.0
26
- gemfile: gemfiles/activerecord_5.0.gemfile
27
- - rvm: 2.2.0
28
- gemfile: gemfiles/activerecord_5.0.gemfile
29
- - rvm: jruby-9.0.5.0
30
- gemfile: gemfiles/activerecord_5.0.gemfile
31
- notifications:
32
- recipients:
33
- - bryan@bryanrite.com
data/Appraisals DELETED
@@ -1,104 +0,0 @@
1
- appraise "activerecord_3.2" do
2
- gem "activerecord", "~> 3.2.0", :require => "active_record"
3
- gem "actionpack", "~> 3.2.0", :require => "action_pack"
4
-
5
- gemfile.platforms :jruby do
6
- gem "activerecord-jdbcsqlite3-adapter"
7
- gem "jdbc-sqlite3"
8
- end
9
-
10
- gemfile.platforms :ruby, :mswin, :mingw do
11
- gem "sqlite3"
12
- end
13
- end
14
-
15
- appraise "activerecord_4.0" do
16
- gem "activerecord", "~> 4.0.5", :require => "active_record"
17
- gem "activesupport", "~> 4.0.5", :require => "active_support/all"
18
- gem "actionpack", "~> 4.0.5", :require => "action_pack"
19
-
20
-
21
- gemfile.platforms :jruby do
22
- gem "activerecord-jdbcsqlite3-adapter"
23
- gem "jdbc-sqlite3"
24
- end
25
-
26
- gemfile.platforms :ruby, :mswin, :mingw do
27
- gem "sqlite3"
28
- end
29
- end
30
-
31
- appraise "activerecord_4.1" do
32
- gem "activerecord", "~> 4.1.1", :require => "active_record"
33
- gem "activesupport", "~> 4.1.1", :require => "active_support/all"
34
- gem "actionpack", "~> 4.1.1", :require => "action_pack"
35
-
36
- gemfile.platforms :jruby do
37
- gem "activerecord-jdbcsqlite3-adapter"
38
- gem "jdbc-sqlite3"
39
- end
40
-
41
- gemfile.platforms :ruby, :mswin, :mingw do
42
- gem "sqlite3"
43
- end
44
- end
45
-
46
- appraise "activerecord_4.2" do
47
- gem "activerecord", "~> 4.2.0", :require => "active_record"
48
- gem 'activesupport', '~> 4.2.0', :require => 'active_support/all'
49
- gem "actionpack", "~> 4.2.0", :require => "action_pack"
50
-
51
- gemfile.platforms :jruby do
52
- gem "activerecord-jdbcsqlite3-adapter"
53
- gem "jdbc-sqlite3"
54
- end
55
-
56
- gemfile.platforms :ruby, :mswin, :mingw do
57
- gem "sqlite3"
58
- gem "pg"
59
- end
60
- end
61
-
62
- appraise "activerecord_5.0" do
63
- gem "activerecord", "~> 5.0.0.rc1", :require => "active_record"
64
- gem 'activesupport', '~> 5.0.0.rc1', :require => 'active_support/all'
65
- gem "actionpack", "~> 5.0.0.rc1", :require => "action_pack"
66
-
67
- gemfile.platforms :jruby do
68
- gem "activerecord-jdbcsqlite3-adapter"
69
- gem "jdbc-sqlite3"
70
- end
71
-
72
- gemfile.platforms :ruby, :mswin, :mingw do
73
- gem "sqlite3"
74
- gem "pg"
75
- end
76
- end
77
-
78
- appraise "mongoid_2.x" do
79
- gem "activesupport", "~> 3.0", :require => "active_support/all"
80
- gem "actionpack", "~> 3.0", :require => "action_pack"
81
- gem "mongoid", "~> 2.0.0"
82
-
83
- gemfile.platforms :ruby, :mswin, :mingw do
84
- gem "bson_ext", "~> 1.1"
85
- end
86
-
87
- gemfile.platforms :jruby do
88
- gem "mongo", "~> 1.9.2"
89
- end
90
- end
91
-
92
- appraise "sequel_3.x" do
93
- gem "sequel", "~> 3.48.0"
94
- gem "activesupport", "~> 3.0", :require => "active_support/all"
95
- gem "actionpack", "~> 3.0", :require => "action_pack"
96
-
97
- gemfile.platforms :jruby do
98
- gem "jdbc-sqlite3"
99
- end
100
-
101
- gemfile.platforms :ruby, :mswin, :mingw do
102
- gem "sqlite3"
103
- end
104
- end
@@ -1,527 +0,0 @@
1
- Develop
2
-
3
- Unreleased
4
-
5
- 1.15.0 (June 13th, 2016)
6
-
7
- * Add support for Rails 5 (craig1410)
8
-
9
- 1.14.0 (May 14th, 2016)
10
-
11
- * Use cover for ranges
12
- * Add support for rails 4 enum's (markpmitchell)
13
-
14
- 1.13.1 (Oct 8th, 2015)
15
-
16
- * Fix #merge with empty Ability (jhawthorn)
17
-
18
- 1.13.0 (Oct 7th, 2015)
19
-
20
- * Significantly improve rule lookup time (amarshall)
21
- * Removed deprecation warnings for RSpec 3.2 (NekoNova)
22
-
23
- 1.12.0 (June 28th, 2015)
24
-
25
- * Add a permissions method to Ability (devaroop)
26
-
27
- 1.11.0 (June 15th, 2015)
28
-
29
- * Complete cancancan#115 - Specify authorization action for parent resources. (phallguy)
30
-
31
- 1.10.1 (January 13th, 2015)
32
-
33
- * Fix cancancan#168 - A bug with ActiveRecord 4.2 support causing ProtocolViolation due to named parameters not being passed in.
34
-
35
-
36
- 1.10.0 (January 7th, 2015)
37
-
38
- * Fix i18n issue for Ruby < 1.9.3 (bryanrite)
39
-
40
- * Fix cancancan#149 - Fix an issue loading namespaced models (darthjee)
41
-
42
- * Fix cancancan#160 - Support for Rails 4.2 (marshall-lee)
43
-
44
- * Fix cancancan#153 - More useful output in ability spec matchers (jondkinney)
45
-
46
-
47
- 1.9.2 (August 8th, 2014)
48
-
49
- * Fix cancancan#77, 78 - Fix an issue with associations for namespaced models. (jjp)
50
-
51
-
52
- 1.9.1 (July 21st, 2014)
53
-
54
- * Fix cancancan#101 - Fixes an issue where overjealous use of references would cause issues with scopes when loading associations. (bryanrite)
55
-
56
-
57
- 1.9.0 (July 20th, 2014)
58
-
59
- * Fix cancancan#59 - Parameters are automatically detected and santitized for all actions, not just create and update. (bryanrite)
60
-
61
- * Fix cancancan#97, 72, 40, 39, 26 - Support Active Record 4 properly with references on nested permissions. (scpike, tdg5, Crystark)
62
-
63
-
64
- 1.8.4 (June 24th, 2014)
65
-
66
- * Fix cancancan#86 - Fixes previous RSpec 3 update as there was a bug in the fix for RSpec 2.99. (bryanrite)
67
-
68
-
69
- 1.8.3 (June 24th, 2014)
70
-
71
- * Fix cancancan#85 - Remove deprecation notices for RSpec 3 and continue backwards compatibility. (andypike, bryanrite, porteta)
72
-
73
-
74
- 1.8.2 (June 5th, 2014)
75
-
76
- * Fix cancancan#75 - More specific hash-like object check. (bryanrite)
77
-
78
-
79
- 1.8.1 (May 27th, 2014)
80
-
81
- * Fix cancancan#67 - Sequel tests are run properly for JRuby. (bryanrite)
82
-
83
- * Fix cancancan#68 - Checks for hash-like objects in subject better. (bryanrite)
84
-
85
-
86
- 1.8.0 (May 8th, 2014)
87
-
88
- * Feature cancan#884 - Add a Sequel model adapter (szetobo)
89
-
90
- * Feature cancancan#3 - Permit "can?" check multiple subjects (cefigueiredo)
91
-
92
- * Feature cancancan#29 - Add ability to use a String that will get instance_eval'd or a Proc that will get called as the parameter method option for strong_parameter santization (svoop)
93
-
94
- * Feature cancancan#48 - Define a CanCanCan module. Even though it is not used, it is standard practice to define the module, and helpful for determining between CanCanCan and CanCan for external libraries.
95
-
96
-
97
- 1.7.1 (March 19th, 2014)
98
-
99
- * Fix ryanb/cancan#992 - Remove Rails 4 deprecations for scoped (thejchap & hitendrasingh)
100
-
101
- * Fix cancancan#16 - RSpec expectations are not explicitly required in RSpec > 2.13 (justinaiken & bryanrite)
102
-
103
-
104
- 1.7.0 (February 19th, 2014)
105
-
106
- * Feature #988 Adds support for strong_parameters (bryanrite)
107
-
108
- * Fix #726 - Allow multiple abilities with associations (elabs-dev)
109
-
110
- * Fix #864 - Fix id_param in shallow routes (francocatena)
111
-
112
- * Fix #871 - Fixes nested ability conditions (ricec)
113
-
114
- * Fix #935 - Reduce unnecessary object allocations (grosser)
115
-
116
- * Fix #966 - Fixes a variable name collision in nested conditions (knoopx)
117
-
118
- * Fix #971 - Does not execute "empty?" scope when checking class rule (matt-glover)
119
-
120
- * Fix #974 - Avoid unnecessary sql execution (inkstak)
121
-
122
-
123
- 1.6.10 (May 7, 2013)
124
-
125
- * fix matches_conditons_hash for string values on 1.8 (thanks rrosen)
126
-
127
- * work around SQL injection vulnerability in older Rails versions (thanks steerio) - issue #800
128
-
129
- * add support for nested join conditions (thanks yuszuv) - issue #806
130
-
131
- * fix load_resource "find_by" in mongoid resources (thanks albertobajo) - issue #705
132
-
133
- * fix namespace split behavior (thanks xinuc) - issue #668
134
-
135
-
136
- 1.6.9 (February 4, 2013)
137
-
138
- * fix inserting AND (NULL) to end of SQL queries (thanks jonsgreen) - issue #687
139
-
140
- * fix merge_joins for nested association hashes (thanks DavidMikeSimon) - issues #655, #560
141
-
142
- * raise error on recursive alias_action (thanks fl00r) - issue #660
143
-
144
- * fix namespace controllers not loading params (thanks andhapp) - issues #670, #664
145
-
146
-
147
- 1.6.8 (June 25, 2012)
148
-
149
- * improved support for namespaced controllers and models
150
-
151
- * pass :if and :unless options for load and authorize resource (thanks mauriciozaffari)
152
-
153
- * Travis CI badge (thanks plentz)
154
-
155
- * adding Ability#merge for combining multiple abilities (thanks rogercampos)
156
-
157
- * support for multiple MetaWhere rules (thanks andhapp)
158
-
159
- * various fixes for DataMapper, Mongoid, and Inherited Resource integration
160
-
161
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.7...1.6.8]
162
-
163
-
164
- 1.6.7 (October 4, 2011)
165
-
166
- * fixing nested resource problem caused by namespace addition - issue #482
167
-
168
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.6...1.6.7]
169
-
170
-
171
- 1.6.6 (September 28, 2011)
172
-
173
- * correct "return cant jump across threads" error when using check_authorization (thanks codeprimate) - issues #463, #469
174
-
175
- * fixing tests in development by specifying with_model version (thanks kirkconnell) - issue #476
176
-
177
- * added travis.yml file for TravisCI support (thanks bai) - issue #427
178
-
179
- * better support for namespaced models (thanks whilefalse) - issues #424
180
-
181
- * adding :id_param option to load_and_authorize_resource (thanks skhisma) - issue #425
182
-
183
- * make default unauthorized message translatable text (thanks nhocki) - issue #409
184
-
185
- * improving DataMapper behavior (thanks psanford, maxsum-corin) - issue #410, #373
186
-
187
- * allow :find_by option to be full find method name - issue #335
188
-
189
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.5...1.6.6]
190
-
191
-
192
- 1.6.5 (May 18, 2011)
193
-
194
- * pass action and subject through AccessDenied exception when :through isn't found - issue #366
195
-
196
- * many Mongoid adapter improvements (thanks rahearn, cardagin) - issues #363, #352, #343
197
-
198
- * allow :through option to work with private controller methods - issue #360
199
-
200
- * ensure Mongoid::Document is defined before loading Mongoid adapter - issue #359
201
-
202
- * many DataMapper adapter improvements (thanks emmanuel) - issue #355
203
-
204
- * handle checking nil attributes through associations (thanks thatothermitch) - issue #330
205
-
206
- * improve scope merging - issue #328
207
-
208
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.4...1.6.5]
209
-
210
-
211
- 1.6.4 (March 29, 2011)
212
-
213
- * Fixed mongoid 'or' error - see issue #322
214
-
215
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.3...1.6.4]
216
-
217
-
218
- 1.6.3 (March 25, 2011)
219
-
220
- * Make sure ActiveRecord::Relation is defined before checking conditions against it so Rails 2 is supported again - see issue #312
221
-
222
- * Return subject passed to authorize! - see issue #314
223
-
224
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.2...1.6.3]
225
-
226
-
227
- 1.6.2 (March 18, 2011)
228
-
229
- * Fixed instance loading when :singleton option is used - see issue #310
230
-
231
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.1...1.6.2]
232
-
233
-
234
- 1.6.1 (March 15, 2011)
235
-
236
- * Use Item.new instead of build_item for singleton resource so it doesn't effect database - see issue #304
237
-
238
- * Made accessible_by action default to :index and parent action default to :show instead of :read - see issue #302
239
-
240
- * Reverted Inherited Resources "collection" override since it doesn't seem to be working - see issue #305
241
-
242
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.6.0...1.6.1]
243
-
244
-
245
- 1.6.0 (March 11, 2011)
246
-
247
- * Added MetaWhere support - see issue #194 and #261
248
-
249
- * Allow Active Record scopes in Ability conditions - see issue #257
250
-
251
- * Added :if and :unless options to check_authorization - see issue #284
252
-
253
- * Several Inherited Resources fixes (thanks aq1018, tanordheim and stefanoverna)
254
-
255
- * Pass action name to accessible_by call when loading a collection (thanks amw)
256
-
257
- * Added :prepend option to load_and_authorize_resource to load before other filters - see issue #290
258
-
259
- * Fixed spacing issue in I18n message for multi-word model names - see issue #292
260
-
261
- * Load resource collection for any action which doesn't have an "id" parameter - see issue #296
262
-
263
- * Raise an exception when trying to make a Ability condition with both a hash of conditions and a block - see issue #269
264
-
265
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.5.1...1.6.0]
266
-
267
-
268
- 1.5.1 (January 20, 2011)
269
-
270
- * Fixing deeply nested conditions in Active Record adapter - see issue #246
271
-
272
- * Improving Mongoid support for multiple can and cannot definitions (thanks stellard) - see issue #239
273
-
274
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.5.0...1.5.1]
275
-
276
-
277
- 1.5.0 (January 11, 2011)
278
-
279
- * Added an Ability generator - see issue #170
280
-
281
- * Added DataMapper support (thanks natemueller)
282
-
283
- * Added Mongoid support (thanks bowsersenior)
284
-
285
- * Added skip_load_and_authorize_resource methods to controller class - see issue #164
286
-
287
- * Added support for uncountable resources in index action - see issue #193
288
-
289
- * Cleaned up README and added spec/README
290
-
291
- * Internal: renamed CanDefinition to Rule
292
-
293
- * Internal: added a model adapter layer for easily supporting more ORMs
294
-
295
- * Internal: added .rvmrc to auto-switch to 1.8.7 with gemset - see issue #231
296
-
297
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.4.1...1.5.0]
298
-
299
-
300
- 1.4.1 (November 12, 2010)
301
-
302
- * Renaming skip_authorization to skip_authorization_check - see issue #169
303
-
304
- * Adding :through_association option to load_resource (thanks hunterae) - see issue #171
305
-
306
- * The :shallow option now works with the :singleton option (thanks nandalopes) - see issue #187
307
-
308
- * Play nicely with quick_scopes gem (thanks ramontayag) - see issue #183
309
-
310
- * Fix odd behavior when "cache_classes = false" (thanks mphalliday) - see issue #174
311
-
312
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.4.0...1.4.1]
313
-
314
-
315
- 1.4.0 (October 5, 2010)
316
-
317
- * Adding Gemfile; to get specs running just +bundle+ and +rake+ - see issue #163
318
-
319
- * Stop at 'cannot' definition when there are no conditions - see issue #161
320
-
321
- * The :through option will now call a method with that name if instance variable doesn't exist - see issue #146
322
-
323
- * Adding :shallow option to load_resource to bring back old behavior of fetching a child without a parent
324
-
325
- * Raise AccessDenied error when loading a child and parent resource isn't found
326
-
327
- * Abilities defined on a module will apply to anything that includes that module - see issue #150 and #152
328
-
329
- * Abilities can be defined with a string of SQL in addition to a block so accessible_by works with a block - see issue #150
330
-
331
- * Adding better support for InheritedResource - see issue #23
332
-
333
- * Loading the collection instance variable (for index action) using accessible_by - see issue #137
334
-
335
- * Adding action and subject variables to I18n unauthorized message - closes #142
336
-
337
- * Adding check_authorization and skip_authorization controller class methods to ensure authorization is performed (thanks justinko) - see issue #135
338
-
339
- * Setting initial attributes based on ability conditions in new/create actions - see issue #114
340
-
341
- * Check parent attributes for nested association in index action - see issue #121
342
-
343
- * Supporting nesting in can? method using hash - see issue #121
344
-
345
- * Adding I18n support for Access Denied messages (thanks EppO) - see issue #103
346
-
347
- * Passing no arguments to +can+ definition will pass action, class, and object to block - see issue #129
348
-
349
- * Don't pass action to block in +can+ definition when using :+manage+ option - see issue #129
350
-
351
- * No longer calling block in +can+ definition when checking on class - see issue #116
352
-
353
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.3.4...1.4.0]
354
-
355
-
356
- 1.3.4 (August 31, 2010)
357
-
358
- * Don't stop at +cannot+ with hash conditions when checking class (thanks tamoya) - see issue #131
359
-
360
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.3.3...1.3.4]
361
-
362
-
363
- 1.3.3 (August 20, 2010)
364
-
365
- * Switching to Rspec namespace to remove deprecation warning in Rspec 2 - see issue #119
366
-
367
- * Pluralize nested associations for conditions in accessible_by (thanks mlooney) - see issue #123
368
-
369
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.3.2...1.3.3]
370
-
371
-
372
- 1.3.2 (August 7, 2010)
373
-
374
- * Fixing slice error when passing in custom resource name - see issue #112
375
-
376
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.3.1...1.3.2]
377
-
378
-
379
- 1.3.1 (August 6, 2010)
380
-
381
- * Fixing protected sanitize_sql error - see issue #111
382
-
383
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.3.0...1.3.1]
384
-
385
-
386
- 1.3.0 (August 6, 2010)
387
-
388
- * Adding :find_by option to load_resource - see issue #19
389
-
390
- * Adding :singleton option to load_resource - see issue #93
391
-
392
- * Supporting multiple resources in :through option for polymorphic associations - see issue #73
393
-
394
- * Supporting Single Table Inheritance for "can" comparisons - see issue #55
395
-
396
- * Adding :instance_name option to load/authorize_resource - see issue #44
397
-
398
- * Don't pass nil to "new" to keep MongoMapper happy - see issue #63
399
-
400
- * Parent resources are now authorized with :read action.
401
-
402
- * Changing :resource option in load/authorize_resource back to :class with ability to pass false
403
-
404
- * Removing :nested option in favor of :through option with separate load/authorize call
405
-
406
- * Moving internal logic from ResourceAuthorization to ControllerResource class
407
-
408
- * Supporting multiple "can" and "cannot" calls with accessible_by (thanks funny-falcon) - see issue #71
409
-
410
- * Supporting deeply nested aliases - see issue #98
411
-
412
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.2.0...1.3.0]
413
-
414
-
415
- 1.2.0 (July 16, 2010)
416
-
417
- * Load nested parent resources on collection actions such as "index" (thanks dohzya)
418
-
419
- * Adding :name option to load_and_authorize_resource if it does not match controller - see issue #65
420
-
421
- * Fixing issue when using accessible_by with nil can conditions (thanks jrallison) - see issue #66
422
-
423
- * Pluralize table name for belongs_to associations in can conditions hash (thanks logandk) - see issue #62
424
-
425
- * Support has_many association or arrays in can conditions hash
426
-
427
- * Adding joins clause to accessible_by when conditions are across associations
428
-
429
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.1.1...1.2.0]
430
-
431
-
432
- 1.1.1 (April 17, 2010)
433
-
434
- * Fixing behavior in Rails 3 by properly initializing ResourceAuthorization
435
-
436
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.1...1.1.1]
437
-
438
-
439
- 1.1.0 (April 17, 2010)
440
-
441
- * Supporting arrays, ranges, and nested hashes in ability conditions
442
-
443
- * Removing "unauthorized!" method in favor of "authorize!" in controllers
444
-
445
- * Adding action, subject and default_message abilities to AccessDenied exception - see issue #40
446
-
447
- * Adding caching to current_ability controller method, if you're overriding this be sure to add caching too.
448
-
449
- * Adding "accessible_by" method to Active Record for fetching records matching a specific ability
450
-
451
- * Adding conditions behavior to Ability#can and fetch with Ability#conditions - see issue #53
452
-
453
- * Renaming :class option to :resource for load_and_authorize_resource which now supports a symbol for non models - see issue #45
454
-
455
- * Properly handle Admin::AbilitiesController in params[:controller] - see issue #46
456
-
457
- * Adding be_able_to RSpec matcher (thanks dchelimsky), requires Ruby 1.8.7 or higher - see issue #54
458
-
459
- * Support additional arguments to can? which get passed to the block - see issue #48
460
-
461
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.0.2...1.1]
462
-
463
-
464
- 1.0.2 (Dec 30, 2009)
465
-
466
- * Adding clear_aliased_actions to Ability which removes previously defined actions including defaults - see issue #20
467
-
468
- * Append aliased actions (don't overwrite them) - see issue #20
469
-
470
- * Adding custom message argument to unauthorized! method (thanks tjwallace) - see issue #18
471
-
472
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.0.1...1.0.2]
473
-
474
-
475
- 1.0.1 (Dec 14, 2009)
476
-
477
- * Adding :class option to load_resource so one can customize which class to use for the model - see issue #17
478
-
479
- * Don't fetch parent of nested resource if *_id parameter is missing so it works with shallow nested routes - see issue #14
480
-
481
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/1.0.0...1.0.1]
482
-
483
-
484
- 1.0.0 (Dec 13, 2009)
485
-
486
- * Don't set resource instance variable if it has been set already - see issue #13
487
-
488
- * Allowing :nested option to accept an array for deep nesting
489
-
490
- * Adding :nested option to load resource method - see issue #10
491
-
492
- * Pass :only and :except options to before filters for load/authorize resource methods.
493
-
494
- * Adding :collection and :new options to load_resource method so we can specify behavior of additional actions if needed.
495
-
496
- * BACKWARDS INCOMPATIBLE: turning load and authorize resource methods into class methods which set up the before filter so they can accept additional arguments.
497
-
498
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/0.2.1...1.0.0]
499
-
500
-
501
- 0.2.1 (Nov 26, 2009)
502
-
503
- * many internal refactorings - see issues #11 and #12
504
-
505
- * adding "cannot" method to define which abilities cannot be done - see issue #7
506
-
507
- * support custom objects (usually symbols) in can definition - see issue #8
508
-
509
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/0.2.0...0.2.1]
510
-
511
-
512
- 0.2.0 (Nov 17, 2009)
513
-
514
- * fix behavior of load_and_authorize_resource for namespaced controllers - see issue #3
515
-
516
- * support arrays being passed to "can" to specify multiple actions or classes - see issue #2
517
-
518
- * adding "cannot?" method to ability, controller, and view which is inverse of "can?" - see issue #1
519
-
520
- * BACKWARDS INCOMPATIBLE: use Ability#initialize instead of 'prepare' to set up abilities - see issue #4
521
-
522
- * {see the full list of changes}[https://github.com/ryanb/cancan/compare/0.1.0...0.2.0]
523
-
524
-
525
- 0.1.0 (Nov 16, 2009)
526
-
527
- * initial release