vigilante 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -7,7 +7,12 @@ class PermissionHash < HashWithIndifferentAccess
7
7
 
8
8
  # default initialization
9
9
  def initialize(default_start = DEFAULT_PERMISSIONS)
10
- super( default_start )
10
+ new_start = HashWithIndifferentAccess.new
11
+ #deep clone the default_start to not change it
12
+ default_start.each do |key, val|
13
+ new_start[key] = val.clone
14
+ end
15
+ super( new_start )
11
16
  end
12
17
 
13
18
  # add extra allowed actions
@@ -84,7 +89,6 @@ class PermissionHash < HashWithIndifferentAccess
84
89
 
85
90
  def get_permissions_by_context(extents)
86
91
  # start from the empty permissions
87
- Rails.logger.debug "get_permissions_by_context received #{extents.inspect}"
88
92
  result = {}
89
93
  # add specific extents
90
94
  unless extents.nil? || self.is_global?
@@ -94,13 +98,10 @@ class PermissionHash < HashWithIndifferentAccess
94
98
  result.merge!(permissions_for_ctx) unless permissions_for_ctx.nil?
95
99
  end
96
100
  end
97
- Rails.logger.debug "get_permissions_by_context after extents built #{result.inspect}"
98
101
 
99
102
  # add general extent only if we have nothing specific
100
103
  result = {}.merge(self['*']) if result == {}
101
104
 
102
- Rails.logger.debug "get_permissions_by_context built #{result.inspect}"
103
-
104
105
  result
105
106
  end
106
107
 
@@ -124,8 +125,4 @@ class PermissionHash < HashWithIndifferentAccess
124
125
  result
125
126
  end
126
127
 
127
-
128
-
129
-
130
-
131
128
  end
data/vigilante.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "vigilante"
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Van der Auwera"]
12
- s.date = "2013-09-16"
12
+ s.date = "2013-10-21"
13
13
  s.description = "Vigilante is a db-backed authorisation, completely configurable and dynamic; where permissions can be limited to extents."
14
14
  s.email = "nathan@dixis.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vigilante
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-16 00:00:00.000000000 Z
12
+ date: 2013-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  segments:
205
205
  - 0
206
- hash: -1531748600046147713
206
+ hash: -2015582756874318279
207
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  none: false
209
209
  requirements: