action-guard 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/action-guard.gemspec +2 -2
- data/lib/action-guard/syntax.rb +1 -1
- data/spec/action-guard_spec.rb +5 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/action-guard.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "action-guard"
|
8
|
-
s.version = "1.2.
|
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.
|
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
|
data/lib/action-guard/syntax.rb
CHANGED
data/spec/action-guard_spec.rb
CHANGED
@@ -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:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
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.
|
176
|
+
summary: Action guard-1.2.1
|
177
177
|
test_files: []
|
178
178
|
|