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