sanction 2.1.1 → 2.1.2
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/sanction/node.rb +6 -1
- data/lib/sanction/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef97b7042edafedf55e2bde7da8dede6a1aa628a
|
|
4
|
+
data.tar.gz: 6f41a829e4b0a53bbd138d65ae29d6b138a2f51a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 428b993f4be88352331de15a703e56440030b35e52277cecc7c4012d44d78699b190dd9957b9f0a24e60a0df2d5d5ff6b7dda44c7dcef0abca7ac89249691bd6
|
|
7
|
+
data.tar.gz: 169be6b0f3db5d5f1d85e1547aca66de2fd7d8b26fc8959ed78cc395371ba27296db9cab3c8a6599c4284e5377cd2593befbd9ee9c5f4252c6dee262626b7fa6
|
data/.gitignore
CHANGED
data/lib/sanction/node.rb
CHANGED
|
@@ -89,12 +89,13 @@ module Sanction
|
|
|
89
89
|
return @scope if (parent.blank? && root?)
|
|
90
90
|
@scope.blank? ? parent.scope : @scope
|
|
91
91
|
end
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
def scope=(attribute)
|
|
94
94
|
@scope = [attribute].flatten.compact.map(&:to_sym)
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def add_scope(attribute)
|
|
98
|
+
clone_scope! if @scope.blank?
|
|
98
99
|
@scope << attribute.to_sym
|
|
99
100
|
sanitize_scope!
|
|
100
101
|
end
|
|
@@ -132,6 +133,10 @@ module Sanction
|
|
|
132
133
|
|
|
133
134
|
private
|
|
134
135
|
|
|
136
|
+
def clone_scope!
|
|
137
|
+
@scope = parent.scope.dup
|
|
138
|
+
end
|
|
139
|
+
|
|
135
140
|
def sanitize_scope!
|
|
136
141
|
@scope = @scope.flatten.compact.uniq.map(&:to_sym)
|
|
137
142
|
end
|
data/lib/sanction/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sanction
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Carlile
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-
|
|
12
|
+
date: 2015-03-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
150
150
|
version: '0'
|
|
151
151
|
requirements: []
|
|
152
152
|
rubyforge_project:
|
|
153
|
-
rubygems_version: 2.
|
|
153
|
+
rubygems_version: 2.4.5
|
|
154
154
|
signing_key:
|
|
155
155
|
specification_version: 4
|
|
156
156
|
summary: A permissions gem for people who love JSON
|