arrthorizer 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/arrthorizer.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency 'rails'
20
+ gem.add_dependency 'rails', '>= 3.2.18'
21
21
  gem.add_development_dependency 'combustion', '~> 0.5.1'
22
22
  gem.add_development_dependency 'sqlite3'
23
23
  gem.add_development_dependency 'rspec-rails'
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 3.2.16'
3
+ gem 'rails', '~> 3.2.18'
4
4
 
5
5
  gemspec path: '../'
6
6
 
@@ -34,7 +34,10 @@ module Arrthorizer
34
34
  end
35
35
  end
36
36
 
37
- def arrthorizer_find_applicable_role(roles)
37
+ def arrthorizer_has_applicable_roles?
38
+ action = Arrthorizer::Rails::ControllerAction.get_current(self)
39
+ roles = action.privilege.permitted_roles
40
+
38
41
  roles.any? do |role|
39
42
  arrthorizer_check_role(role, arrthorizer_context)
40
43
  end
@@ -45,10 +48,7 @@ module Arrthorizer
45
48
  end
46
49
 
47
50
  def authorize
48
- action = Arrthorizer::Rails::ControllerAction.get_current(self)
49
- roles = action.privilege.permitted_roles
50
-
51
- arrthorizer_find_applicable_role(roles) || forbidden
51
+ arrthorizer_has_applicable_roles? || forbidden
52
52
  end
53
53
 
54
54
  def arrthorizer_context_builder
@@ -1,3 +1,3 @@
1
1
  module Arrthorizer
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arrthorizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-05 00:00:00.000000000 Z
13
+ date: 2014-07-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: '0'
22
+ version: 3.2.18
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
- version: '0'
30
+ version: 3.2.18
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: combustion
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  segments:
202
202
  - 0
203
- hash: 2700681613748034197
203
+ hash: 4363344395387857595
204
204
  required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  none: false
206
206
  requirements:
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  segments:
211
211
  - 0
212
- hash: 2700681613748034197
212
+ hash: 4363344395387857595
213
213
  requirements: []
214
214
  rubyforge_project:
215
215
  rubygems_version: 1.8.24