authorization-san 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,4 +26,5 @@ In order of appearance:
26
26
 
27
27
  * Manfred Stienstra <manfred@fngtps.com>
28
28
  * Eloy Duran <eloy@fngtps.com>
29
- * Hrvoje Šimić <shime.ferovac@gmail.com>
29
+ * Hrvoje Šimić <shime.ferovac@gmail.com>
30
+ * Jeff Kreeftmeijer <jeff@fngtps.com>
@@ -7,7 +7,7 @@ module Authorization
7
7
  end
8
8
 
9
9
  def _die_if_undefined #:nodoc:
10
- _raise_undefined_error if access_allowed_for.nil?
10
+ _raise_undefined_error if defined?(access_allowed_for).nil? || access_allowed_for.nil?
11
11
  rescue NoMethodError
12
12
  _raise_undefined_error
13
13
  end
@@ -71,7 +71,14 @@ module Authorization
71
71
  end
72
72
 
73
73
  def _block_is_successful?(block) #:nodoc:
74
- block ? block.bind(self).call : true
74
+ return true unless block
75
+
76
+ if respond_to?(:instance_exec)
77
+ self.instance_exec(&block)
78
+ else
79
+ # deprecated in Rails 4.x
80
+ block.bind(self).call
81
+ end
75
82
  end
76
83
 
77
84
  def _access_allowed_with_rule?(rule, params, role, authenticated) #:nodoc:
@@ -111,4 +118,4 @@ module Authorization
111
118
  end
112
119
  end
113
120
 
114
- require 'authorization/deprecated'
121
+ require 'authorization/deprecated'
metadata CHANGED
@@ -1,24 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: authorization-san
3
- version: !ruby/object:Gem::Version
4
- version: 2.2.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
5
  prerelease:
6
+ segments:
7
+ - 2
8
+ - 3
9
+ - 0
10
+ version: 2.3.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Manfred Stienstra
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-06-22 00:00:00.000000000 Z
17
+
18
+ date: 2014-03-21 00:00:00 +01:00
19
+ default_executable:
13
20
  dependencies: []
21
+
14
22
  description: A plugin for authorization in a ReSTful application.
15
23
  email: manfred@fngtps.com
16
24
  executables: []
25
+
17
26
  extensions: []
18
- extra_rdoc_files:
27
+
28
+ extra_rdoc_files:
19
29
  - LICENSE
20
30
  - README.rdoc
21
- files:
31
+ files:
22
32
  - LICENSE
23
33
  - README.rdoc
24
34
  - lib/authorization.rb
@@ -26,28 +36,39 @@ files:
26
36
  - lib/authorization/block_access.rb
27
37
  - lib/authorization/deprecated.rb
28
38
  - rails/init.rb
39
+ has_rdoc: true
29
40
  homepage: http://fingertips.github.com
30
41
  licenses: []
42
+
31
43
  post_install_message:
32
44
  rdoc_options: []
33
- require_paths:
45
+
46
+ require_paths:
34
47
  - lib
35
- required_ruby_version: !ruby/object:Gem::Requirement
48
+ required_ruby_version: !ruby/object:Gem::Requirement
36
49
  none: false
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ hash: 3
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
58
  none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
47
66
  requirements: []
67
+
48
68
  rubyforge_project:
49
- rubygems_version: 1.8.23
69
+ rubygems_version: 1.6.2
50
70
  signing_key:
51
71
  specification_version: 3
52
72
  summary: A plugin for authorization in a ReSTful application.
53
73
  test_files: []
74
+