walruz 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ * 0.0.14 (Jul 27, 2011)
2
+ * Fixing a bug regarding policy label not being found on anonymous
3
+ (composite) policy classes
4
+
5
+
1
6
  * 0.0.13 (Jul 21, 2011)
2
7
  * Adding a new method to the Walruz::Manager class: satisfies!, same behaviour
3
8
  than satisfies, but raises a Walruz::NotAuthorized error if the actor and
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :build:
3
3
  :major: 0
4
4
  :minor: 0
5
- :patch: 13
5
+ :patch: 14
data/lib/walruz/policy.rb CHANGED
@@ -173,7 +173,11 @@ module Walruz
173
173
  # - label: Symbol that represents the policy
174
174
  #
175
175
  def self.set_policy_label(label)
176
- Walruz.policies[label] = Walruz.policies.delete(self.policy_label)
176
+ if self.name.nil? || self.name.empty?
177
+ Walruz.policies[label] = self
178
+ else
179
+ Walruz.policies[label] = Walruz.policies.delete(self.policy_label)
180
+ end
177
181
  @policy_label = label
178
182
  end
179
183
 
@@ -28,6 +28,13 @@ describe Walruz do
28
28
  Walruz.fetch_policy(:author_in_colaboration_policy)
29
29
  end.should raise_error(Walruz::ActionNotFound)
30
30
  end
31
+
32
+ it 'should fetch anonymous policies with a specified label' do
33
+ new_policy = Walruz::Utils.any(AuthorInColaborationPolicy,
34
+ ColaboratingWithJohnPolicy)
35
+ new_policy.set_policy_label(:crazy_policy)
36
+ Walruz.fetch_policy(:crazy_policy).should == new_policy
37
+ end
31
38
 
32
39
  end
33
40
 
data/walruz.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{walruz}
8
- s.version = "0.0.13"
8
+ s.version = "0.0.14"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roman Gonzalez"]
12
- s.date = %q{2011-07-21}
12
+ s.date = %q{2011-07-27}
13
13
  s.description = %q{
14
14
  Walruz provides an easy to use DSL to do composition of basic
15
15
  authorization policies to create more complex ones, and then register
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: walruz
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 13
10
- version: 0.0.13
9
+ - 14
10
+ version: 0.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Gonzalez
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-21 00:00:00 -07:00
18
+ date: 2011-07-27 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency