heimdallr 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 1.0.3
4
+
5
+ Everything that returns from `can :view` scope should be restricted if possible. [@whitequark][]
6
+
7
+ [@whitequark]: http://twitter.com/#!/whitequark
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "heimdallr"
6
- s.version = "1.0.2"
6
+ s.version = "1.0.3"
7
7
  s.authors = ["Peter Zotov", "Boris Staal"]
8
8
  s.email = ["whitequark@whitequark.org", "boris@roundlake.ru"]
9
9
  s.homepage = "http://github.com/roundlake/heimdallr"
@@ -195,7 +195,12 @@ module Heimdallr
195
195
  elsif @record.respond_to? method
196
196
  if [nil, '?'].include?(suffix)
197
197
  if @restrictions.allowed_fields[:view].include?(normalized_method)
198
- @record.send method, *args, &block
198
+ result = @record.send method, *args, &block
199
+ if result.respond_to? :restrict
200
+ result.restrict(@context, @options)
201
+ else
202
+ result
203
+ end
199
204
  elsif @options[:implicit]
200
205
  nil
201
206
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heimdallr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-12 00:00:00.000000000 Z
13
+ date: 2012-04-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
- requirement: &70206639185180 !ruby/object:Gem::Requirement
17
+ requirement: &70171398246540 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70206639185180
25
+ version_requirements: *70171398246540
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activemodel
28
- requirement: &70206639184300 !ruby/object:Gem::Requirement
28
+ requirement: &70171398246060 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70206639184300
36
+ version_requirements: *70171398246060
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &70206639183840 !ruby/object:Gem::Requirement
39
+ requirement: &70171398245680 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70206639183840
47
+ version_requirements: *70171398245680
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: activerecord
50
- requirement: &70206639183200 !ruby/object:Gem::Requirement
50
+ requirement: &70171398245220 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70206639183200
58
+ version_requirements: *70171398245220
59
59
  description: ! "Heimdallr aims to provide an easy to configure and efficient object-
60
60
  and field-level access\n control solution, reusing proven patterns from gems like
61
61
  CanCan and allowing one to manage permissions in a very\n fine-grained manner."
@@ -69,6 +69,7 @@ files:
69
69
  - .gitignore
70
70
  - .rspec
71
71
  - .yardopts
72
+ - CHANGELOG.md
72
73
  - Gemfile
73
74
  - LICENSE
74
75
  - README.md