action-guard 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "action-guard"
8
- s.version = "1.2.0"
8
+ s.version = "1.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rob Westgeest"]
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.rdoc_options = ["--charset=UTF-8"]
44
44
  s.require_paths = ["lib"]
45
45
  s.rubygems_version = "1.8.24"
46
- s.summary = "Action guard-1.2.0"
46
+ s.summary = "Action guard-1.2.1"
47
47
 
48
48
  if s.respond_to? :specification_version then
49
49
  s.specification_version = 3
@@ -12,7 +12,7 @@ module ActionGuard
12
12
  elsif options.has_key? :only_by
13
13
  @guard.exact_role_rule(path, options[:only_by])
14
14
  else
15
- @guard.allow_rule path
15
+ @guard.allow_rule(path, &block)
16
16
  end
17
17
  end
18
18
  end
@@ -291,6 +291,9 @@ describe ActionGuard do
291
291
  allow 'some_controller#some_action', :at_least => :admin
292
292
  allow 'some_controller#when_role_matches_exact', :only_by => :worker
293
293
  allow 'some_controller#when_matches_exact_by_implication', :at_least => :worker, :at_most => :worker
294
+ allow 'some_controller#when_block_returns_false' do |account, request_params|
295
+ false
296
+ end
294
297
  allow '' # wildcard for other controllers
295
298
  }
296
299
  guard.should authorize(account_with_role(:admin)).to_perform_action('some_controller#some_action')
@@ -301,6 +304,8 @@ describe ActionGuard do
301
304
  guard.should_not authorize(account_with_role(:admin)).to_perform_action('some_controller#when_role_matches_exact')
302
305
  guard.should authorize(account_with_role(:worker)).to_perform_action('some_controller#when_matches_exact_by_implication')
303
306
  guard.should_not authorize(account_with_role(:admin)).to_perform_action('some_controller#when_matches_exact_by_implication')
307
+ guard.should_not authorize(nil).to_perform_action('some_controller#when_block_returns_false')
308
+
304
309
  end
305
310
  end
306
311
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action-guard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 0
10
- version: 1.2.0
9
+ - 1
10
+ version: 1.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rob Westgeest
@@ -173,6 +173,6 @@ rubyforge_project:
173
173
  rubygems_version: 1.8.24
174
174
  signing_key:
175
175
  specification_version: 3
176
- summary: Action guard-1.2.0
176
+ summary: Action guard-1.2.1
177
177
  test_files: []
178
178