action_policy-graphql 0.5.2 → 0.5.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/action_policy/graphql/authorized_field.rb +3 -2
- data/lib/action_policy/graphql/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: bd65d3395a5a17016bbf6437bdcc300c1c515d3a6ec72aa4a9f499c0f642fbce
|
|
4
|
+
data.tar.gz: 3fde00df90ed713411873303ddf920937c9bcc92d7db37f765eecfc7e03a408c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7474adcbe2a40bb7ac9f30ac3068987ac419c56e394dafd1440d6ad1f4457f7a07aa5c5ef8ec07e8fee348bd8e464a753fd4306070a00af500af0e53755925dc
|
|
7
|
+
data.tar.gz: 04aaf4d7dacd8ad07324dc913e45b04a43f515e79ca6de7d530436d357b559bdd52632ae9231a799b9255139d574e744e2a3c1c453e3838213a33d409efea5be
|
data/CHANGELOG.md
CHANGED
|
@@ -39,7 +39,7 @@ module ActionPolicy
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def apply
|
|
42
|
-
self.class.show_authorize_mutation_deprecation if field.mutation
|
|
42
|
+
self.class.show_authorize_mutation_deprecation if field.mutation && field.mutation < ::GraphQL::Schema::Mutation
|
|
43
43
|
|
|
44
44
|
@to = extract_option(:to) { ::ActionPolicy::GraphQL.default_authorize_rule }
|
|
45
45
|
@raise = extract_option(:raise) { ::ActionPolicy::GraphQL.authorize_raise_exception }
|
|
@@ -114,7 +114,8 @@ module ActionPolicy
|
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
class ScopeExtension < Extension
|
|
117
|
-
def
|
|
117
|
+
def resolve(context:, object:, arguments:, **_rest)
|
|
118
|
+
value = yield(object, arguments)
|
|
118
119
|
return value if value.nil?
|
|
119
120
|
|
|
120
121
|
object.authorized_scope(value, **options)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: action_policy-graphql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vladimir Dementyev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: action_policy
|