petergate 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/petergate.rb +13 -2
- data/lib/petergate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 477d5115ba11244c1736a528c9e853ec9f1b9f56
|
4
|
+
data.tar.gz: f75c1c312bc7ef5e18aee99cf83664348c5d2795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f01776df6390edb2bfe35ed1f6a6bfef61eb495e530785091de0676c965f425033673004d2fd8707f019a7462b404ac8562a7246e03039340db9660ffacb06b
|
7
|
+
data.tar.gz: a3a38fa8b950adb78f1d54ef5b66479c7af5456c7c7849e27cf24cc8bdcd4a2c83d1890f0d1cc891751b0f2292afd0ab44fb7fa91b9def712ae98e64e7b057ad
|
data/lib/petergate.rb
CHANGED
@@ -8,8 +8,19 @@ module PeterGate
|
|
8
8
|
b_rules = block.call
|
9
9
|
rules = rules.merge(b_rules) if b_rules.is_a?(Hash)
|
10
10
|
end
|
11
|
-
|
12
|
-
|
11
|
+
|
12
|
+
instance_eval do
|
13
|
+
@_controller_rules = rules
|
14
|
+
|
15
|
+
def controller_rules
|
16
|
+
@_controller_rules
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class_eval do
|
21
|
+
def check_access
|
22
|
+
perms(self.class.controller_rules)
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
data/lib/petergate/version.rb
CHANGED