warrant 2.0.0.rc1 → 2.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/warrant/models/warrant.rb +18 -18
- data/lib/warrant/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: 4843a74fe1b3946f08604adac74e8aaea3f62d78cf8c737675c04a95b276703d
|
4
|
+
data.tar.gz: 27a4e728b04fef498d7ff4b7e1c030d5ccbc10f5272aec4a8ccb4be15c22b836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c04647e27e78c116990c3980fbee91057d3bae5cdbd7fe9711e50585476f91919cc5a24e98f1abab6cdbcd0848eca3e20a74b1af7fae6f58d2e973d2b080a9
|
7
|
+
data.tar.gz: 01cfa6e56f75d458e41f39af8b8190e76205cf9f93c69107fab52e0645ffbef5a0a8de9333e0a729c95725b2010e0cb874016d7191225d0ba68bd86e967ad667
|
@@ -32,12 +32,12 @@ module Warrant
|
|
32
32
|
# @raise [Warrant::WarrantError]
|
33
33
|
def self.create(object, relation, subject, context = nil)
|
34
34
|
params = {
|
35
|
-
object_type: object.warrant_object_type,
|
36
|
-
object_id: object.warrant_object_id,
|
35
|
+
object_type: object.warrant_object_type.to_s,
|
36
|
+
object_id: object.warrant_object_id.to_s,
|
37
37
|
relation: relation,
|
38
38
|
subject: {
|
39
|
-
object_type: subject.warrant_object_type,
|
40
|
-
object_id: subject.warrant_object_id
|
39
|
+
object_type: subject.warrant_object_type.to_s,
|
40
|
+
object_id: subject.warrant_object_id.to_s
|
41
41
|
},
|
42
42
|
context: context
|
43
43
|
}
|
@@ -69,12 +69,12 @@ module Warrant
|
|
69
69
|
# @raise [Warrant::WarrantError]
|
70
70
|
def self.delete(object, relation, subject, context = nil)
|
71
71
|
params = {
|
72
|
-
object_type: object.warrant_object_type,
|
73
|
-
object_id: object.warrant_object_id,
|
72
|
+
object_type: object.warrant_object_type.to_s,
|
73
|
+
object_id: object.warrant_object_id.to_s,
|
74
74
|
relation: relation,
|
75
75
|
subject: {
|
76
|
-
object_type: subject.warrant_object_type,
|
77
|
-
object_id: subject.warrant_object_id
|
76
|
+
object_type: subject.warrant_object_type.to_s,
|
77
|
+
object_id: subject.warrant_object_id.to_s
|
78
78
|
},
|
79
79
|
context: context
|
80
80
|
}
|
@@ -193,16 +193,16 @@ module Warrant
|
|
193
193
|
}.compact!
|
194
194
|
else
|
195
195
|
subject = {
|
196
|
-
object_type: subject.warrant_object_type,
|
197
|
-
object_id: subject.warrant_object_id
|
196
|
+
object_type: subject.warrant_object_type.to_s,
|
197
|
+
object_id: subject.warrant_object_id.to_s
|
198
198
|
}
|
199
199
|
end
|
200
200
|
|
201
201
|
unless ::Warrant.config.authorize_endpoint.nil?
|
202
202
|
return edge_authorize?(
|
203
203
|
warrants: [{
|
204
|
-
object_type: object.warrant_object_type,
|
205
|
-
object_id: object.warrant_object_id,
|
204
|
+
object_type: object.warrant_object_type.to_s,
|
205
|
+
object_id: object.warrant_object_id.to_s,
|
206
206
|
relation: relation,
|
207
207
|
subject: subject,
|
208
208
|
context: options[:context]
|
@@ -214,8 +214,8 @@ module Warrant
|
|
214
214
|
|
215
215
|
return authorize?(
|
216
216
|
warrants: [{
|
217
|
-
object_type: object.warrant_object_type,
|
218
|
-
object_id: object.warrant_object_id,
|
217
|
+
object_type: object.warrant_object_type.to_s,
|
218
|
+
object_id: object.warrant_object_id.to_s,
|
219
219
|
relation: relation,
|
220
220
|
subject: subject,
|
221
221
|
context: options[:context]
|
@@ -264,14 +264,14 @@ module Warrant
|
|
264
264
|
}.compact!
|
265
265
|
else
|
266
266
|
subject = {
|
267
|
-
object_type: warrant[:subject].warrant_object_type,
|
268
|
-
object_id: warrant[:subject].warrant_object_id
|
267
|
+
object_type: warrant[:subject].warrant_object_type.to_s,
|
268
|
+
object_id: warrant[:subject].warrant_object_id.to_s
|
269
269
|
}
|
270
270
|
end
|
271
271
|
|
272
272
|
{
|
273
|
-
object_type: warrant[:object].warrant_object_type,
|
274
|
-
object_id: warrant[:object].warrant_object_id,
|
273
|
+
object_type: warrant[:object].warrant_object_type.to_s,
|
274
|
+
object_id: warrant[:object].warrant_object_id.to_s,
|
275
275
|
relation: warrant[:relation],
|
276
276
|
subject: subject,
|
277
277
|
context: warrant[:context]
|
data/lib/warrant/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warrant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Warrant
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby library for the Warrant API at https://warrant.dev.
|
14
14
|
email: hello@warrant.dev
|