passpartu 1.2.0 → 1.2.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/passpartu/patcher.rb +3 -4
- data/lib/passpartu/verify.rb +1 -1
- data/lib/passpartu/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 396d094c919ae767cf6653747b219b0018a95c0672fd8beb9da5c1f0c64fd7c6
|
|
4
|
+
data.tar.gz: fdca15a751308a1c2a6bcf818f21572b7cb1a8e95a8f59c8f363d5431758375a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e548a9a7493741c606bfdb93f6bbe90a082496e76b739645d658e91b531671170053fb1342272d76e5116093184d548aef593c11cbb1e715227427be295d637
|
|
7
|
+
data.tar.gz: e945766a4d0157bc22ce976a4552fd72b62c2ffc5a153c1e1c44fd9dc5996c88f729bc2eba49b6fbc90d6f6472aaf6e46fedc7c52db687aed8d2aa433bc20708
|
data/lib/passpartu/patcher.rb
CHANGED
|
@@ -15,7 +15,6 @@ module Passpartu
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def call
|
|
18
|
-
phash = respond_to?(:policy_hash) ? {} : Passpartu.policy
|
|
19
18
|
role_method = Passpartu.config.role_access_method
|
|
20
19
|
|
|
21
20
|
klass.class_eval do
|
|
@@ -26,12 +25,12 @@ module Passpartu
|
|
|
26
25
|
only: only,
|
|
27
26
|
except: except,
|
|
28
27
|
skip: skip,
|
|
29
|
-
policy_hash:
|
|
28
|
+
policy_hash: -> { respond_to?(:policy_hash) ? policy_hash : Passpartu.policy }.call,
|
|
30
29
|
&block
|
|
31
30
|
)
|
|
32
31
|
end
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
Passpartu.policy.each_key do |policy_role|
|
|
35
34
|
define_method("#{policy_role}_can?") do |*keys, only: nil, except: nil, skip: nil, &block|
|
|
36
35
|
send(role_method).to_s == policy_role &&
|
|
37
36
|
Passpartu::BlockVerify.call(
|
|
@@ -40,7 +39,7 @@ module Passpartu
|
|
|
40
39
|
only: only,
|
|
41
40
|
except: except,
|
|
42
41
|
skip: skip,
|
|
43
|
-
policy_hash:
|
|
42
|
+
policy_hash: -> { respond_to?(:policy_hash) ? policy_hash : Passpartu.policy }.call,
|
|
44
43
|
&block
|
|
45
44
|
)
|
|
46
45
|
end
|
data/lib/passpartu/verify.rb
CHANGED
data/lib/passpartu/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: passpartu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OrestF
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
145
145
|
- !ruby/object:Gem::Version
|
|
146
146
|
version: '0'
|
|
147
147
|
requirements: []
|
|
148
|
-
rubygems_version: 3.4.
|
|
148
|
+
rubygems_version: 3.4.21
|
|
149
149
|
signing_key:
|
|
150
150
|
specification_version: 4
|
|
151
151
|
summary: Passpartu makes policies great again
|