api-blocks 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api_blocks/controller.rb +4 -4
- data/lib/api_blocks/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: d75318555853ecc826f701851966802312197cdd96df8db360727ea962c27dc0
|
4
|
+
data.tar.gz: aeab6992d7a5849d6c8cd95f19217a2ca26a7f17342d9b4953d0790ace882707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283db07ca95c270badcffe63a92861dbc2f4adac6eb7fcf4115ef2285ce2dbb945637292dfdfab71a5906a8b39913939f24813ee088cb8941066f855cffd5f2a
|
7
|
+
data.tar.gz: c6d8718960fde579ab983e6e69c2aab7fa6e3a7c364be1c89e6caa1f058b70b7e1ee099eae34dfceabf2c96e942f0b09b100dec8697e0abdd2b26791fccc5848
|
@@ -35,18 +35,18 @@ module ApiBlocks::Controller
|
|
35
35
|
|
36
36
|
# Override policy_scope to lookup pundit policies under the `scope`
|
37
37
|
# namespace
|
38
|
-
def policy_scope(scope)
|
38
|
+
def policy_scope(scope, policy_scope_class: nil)
|
39
39
|
api_scope = self.class.inherited_pundit_api_scope || []
|
40
40
|
|
41
|
-
super(api_scope + [scope])
|
41
|
+
super(api_scope + [scope], policy_scope_class: policy_scope_class)
|
42
42
|
end
|
43
43
|
|
44
44
|
# Override authorize to lookup pundit policies under the `scope`
|
45
45
|
# namespace
|
46
|
-
def authorize(record, query = nil)
|
46
|
+
def authorize(record, query = nil, policy_class: nil)
|
47
47
|
api_scope = self.class.inherited_pundit_api_scope || []
|
48
48
|
|
49
|
-
super(api_scope + [record], query)
|
49
|
+
super(api_scope + [record], query, policy_class: policy_class)
|
50
50
|
end
|
51
51
|
|
52
52
|
handle_api_error Pundit::NotAuthorizedError do |error|
|
data/lib/api_blocks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-blocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul d'Hubert
|
@@ -226,14 +226,14 @@ dependencies:
|
|
226
226
|
requirements:
|
227
227
|
- - '='
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 0.
|
229
|
+
version: 0.82.0
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - '='
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 0.
|
236
|
+
version: 0.82.0
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: yard
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|