you_shall_not_pass 0.0.2 → 0.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2a0082fe593f22ba8a1ccc446061ed132bb3248
|
4
|
+
data.tar.gz: f9be21782946d49cd83fe2b694d29ca6a153e07c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 225b91dba9bc231f7ff0207523bb1f8d360506aa473e9f399de64b44a8482f9d6b50712066b1bd994a03e90e19b42c273594027430642aa63dc6804383fbd791
|
7
|
+
data.tar.gz: 19679f956b3282381acbca246d940be8cabf690f1e520f22d6cb0c7258ef52d8fd9d6ace5ead2bda13740af9ef723f0bc2b741717ca08aa3c70303d807a10dfe
|
@@ -18,6 +18,9 @@ module YouShallNotPass
|
|
18
18
|
permission.to_s.split("_and_").all? { |policy| can?(policy.to_sym, **args)}
|
19
19
|
elsif permission =~ /_or_/
|
20
20
|
permission.to_s.split("_or_").any? { |policy| can?(policy.to_sym, **args)}
|
21
|
+
elsif permission =~ /\Anot_/
|
22
|
+
policy = permission.to_s.gsub(/\Anot_/, "")
|
23
|
+
! can?(policy.to_sym, **args)
|
21
24
|
else
|
22
25
|
raise e
|
23
26
|
end
|
@@ -197,6 +197,14 @@ scope YouShallNotPass::Authorizator do
|
|
197
197
|
! authorizator.can?(:three_or_four)
|
198
198
|
end
|
199
199
|
|
200
|
+
spec "allow not_" do
|
201
|
+
authorizator.can?(:not_three)
|
202
|
+
end
|
203
|
+
|
204
|
+
spec "reject not_" do
|
205
|
+
! authorizator.can?(:not_one)
|
206
|
+
end
|
207
|
+
|
200
208
|
spec "allow _and_or_" do
|
201
209
|
authorizator.can?(:one_and_two_or_three)
|
202
210
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: you_shall_not_pass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Iachetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|