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