ingress 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ingress/permission_rule.rb +9 -0
- data/lib/ingress/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbb4efc674725b3fcb18ed2651773ecab7af973940f185cb93a94251858a4da
|
4
|
+
data.tar.gz: aadc4a71a1946a19227b1b1a09d37372d056d19020c721a55a1c6cb63a251d20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a63048555be635ef620c670e5f3fe39db3bc56bce272734141e391834b82cf42f3f8bce5e4ab9f7f752cc71b9b76e50307aa2d163bec8c901f5be9ad2fcacbdb
|
7
|
+
data.tar.gz: 555623681279ba944737bbbb77e2b7b5fd65b365dcd840b83581fdb04527839203669977b1d602fe94e720f91fb7e0ab120c889883109a1a89a65490ac357410
|
@@ -16,6 +16,7 @@ module Ingress
|
|
16
16
|
def match?(given_action, given_subject, user, options = {})
|
17
17
|
return false unless action_matches?(given_action)
|
18
18
|
return false unless subject_matches?(given_subject)
|
19
|
+
return true if ignore_conditions?(given_subject)
|
19
20
|
|
20
21
|
conditions_match?(user, given_subject, options)
|
21
22
|
end
|
@@ -35,6 +36,14 @@ module Ingress
|
|
35
36
|
"*" == subject
|
36
37
|
end
|
37
38
|
|
39
|
+
def ignore_conditions?(given_subject)
|
40
|
+
subject_class?(given_subject) && subject_class?(@subject)
|
41
|
+
end
|
42
|
+
|
43
|
+
def subject_class?(subject)
|
44
|
+
[Class, Module].include? subject.class
|
45
|
+
end
|
46
|
+
|
38
47
|
def conditions_match?(user, given_subject, options)
|
39
48
|
conditions.all? do |condition|
|
40
49
|
if condition.arity == 2
|
data/lib/ingress/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ingress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Skorkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|