sanction 2.1.0 → 2.1.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.
- checksums.yaml +4 -4
- data/lib/sanction/blacklist/node.rb +4 -0
- data/lib/sanction/node.rb +17 -3
- data/lib/sanction/version.rb +1 -1
- data/lib/sanction/whitelist/node.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54b4bc26ea4486d4933609a99ce9069cc9d0e006
|
|
4
|
+
data.tar.gz: 61e47caeb74f34362da54ca9e4fc4795502e0141
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eccc4a6e58d4c3db5ead80ef35479c329e64843eb6259096476a2c368b61cc902723ee917c3a6c5147ea94922fd1f0294f869d8abd1d451aa3287ccf8f09b656
|
|
7
|
+
data.tar.gz: e340fc3cb7f86837bf9bf2c5ff91206f7502dda29b0128da593e777de8ae863cefd5badf92d0617cfd91a9106618597761049444650c06f5667db67ca5ae7e21
|
data/lib/sanction/node.rb
CHANGED
|
@@ -86,11 +86,21 @@ module Sanction
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def scope
|
|
89
|
+
return @scope if (parent.blank? && root?)
|
|
89
90
|
@scope.blank? ? parent.scope : @scope
|
|
90
91
|
end
|
|
91
92
|
|
|
92
|
-
def scope=(
|
|
93
|
-
@scope = [
|
|
93
|
+
def scope=(attribute)
|
|
94
|
+
@scope = [attribute].flatten.compact.map(&:to_sym)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def add_scope(attribute)
|
|
98
|
+
@scope << attribute.to_sym
|
|
99
|
+
sanitize_scope!
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def remove_scope(attribute)
|
|
103
|
+
@scope.reject! {|x| x == attribute.to_sym }
|
|
94
104
|
end
|
|
95
105
|
|
|
96
106
|
def resources
|
|
@@ -122,9 +132,13 @@ module Sanction
|
|
|
122
132
|
|
|
123
133
|
private
|
|
124
134
|
|
|
135
|
+
def sanitize_scope!
|
|
136
|
+
@scope = @scope.flatten.compact.uniq.map(&:to_sym)
|
|
137
|
+
end
|
|
138
|
+
|
|
125
139
|
def process_hash(hash)
|
|
126
140
|
@id = hash[:id]
|
|
127
|
-
@scope = hash[:scope].map(&:to_sym)
|
|
141
|
+
@scope = [hash[:scope]].flatten.compact.map(&:to_sym)
|
|
128
142
|
@type = hash[:type].to_sym if hash[:type]
|
|
129
143
|
@resources = []
|
|
130
144
|
@resources += hash[:resources].map(&:to_sym) unless hash[:resources].blank?
|
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.1
|
|
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:
|
|
12
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|