forest_liana 1.3.2 → 1.3.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0a7a2f5a3320218ddd3d59f8d36d9b020cf39137
|
|
4
|
+
data.tar.gz: 6c9c357d204a9fda74ea7273817d2c963ce8f86d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 466f3c4532953d29e9793c3781f41270437e6fd040d2ba0c0674a281fe698e19d35f188bf4b9a0c4daea847b560ae06e33dd9a4187db5ccf210dd6c43af60365
|
|
7
|
+
data.tar.gz: 0eb9233d1138374f2da4726369768e8698194535a11cdbd33e2fcf299ed420cbf07c10b9a1dcf927a14e11b8f43ce7dacdc788c6f1e2590a1dbf75c6fe03b044
|
|
@@ -16,13 +16,12 @@ module ForestLiana
|
|
|
16
16
|
private
|
|
17
17
|
|
|
18
18
|
def fetch_allowed_users
|
|
19
|
-
AllowedUsersGetter.new.perform
|
|
19
|
+
AllowedUsersGetter.new.perform(params['renderingId'])
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def check_user
|
|
23
23
|
ForestLiana.allowed_users.find do |allowed_user|
|
|
24
24
|
allowed_user['email'] == params['email'] &&
|
|
25
|
-
allowed_user['outlines'].include?(params['outlineId']) &&
|
|
26
25
|
BCrypt::Password.new(allowed_user['password']) == params['password']
|
|
27
26
|
end
|
|
28
27
|
end
|
|
@@ -39,10 +38,10 @@ module ForestLiana
|
|
|
39
38
|
last_name: user['last_name']
|
|
40
39
|
},
|
|
41
40
|
relationships: {
|
|
42
|
-
|
|
41
|
+
renderings: {
|
|
43
42
|
data: [{
|
|
44
|
-
type: '
|
|
45
|
-
id: params['
|
|
43
|
+
type: 'renderings',
|
|
44
|
+
id: params['renderingId']
|
|
46
45
|
}]
|
|
47
46
|
}
|
|
48
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module ForestLiana
|
|
2
2
|
class AllowedUsersGetter
|
|
3
|
-
def perform
|
|
4
|
-
uri = URI.parse("#{forest_url}/forest/allowed-users")
|
|
3
|
+
def perform(renderingId)
|
|
4
|
+
uri = URI.parse("#{forest_url}/forest/renderings/#{renderingId}/allowed-users")
|
|
5
5
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
6
6
|
http.use_ssl = true if forest_url.start_with?('https')
|
|
7
7
|
http.start do |client|
|
|
@@ -11,13 +11,10 @@ module ForestLiana
|
|
|
11
11
|
response = client.request(request)
|
|
12
12
|
|
|
13
13
|
if response.is_a?(Net::HTTPOK)
|
|
14
|
-
body = JSON.parse(response.body)
|
|
15
|
-
ForestLiana.allowed_users = body.map do |d|
|
|
14
|
+
body = JSON.parse(response.body)
|
|
15
|
+
ForestLiana.allowed_users = body['data'].map do |d|
|
|
16
16
|
user = d['attributes']
|
|
17
17
|
user['id'] = d['id']
|
|
18
|
-
user['outlines'] = d['relationships']['outlines']['data'].map {
|
|
19
|
-
|x| x['id']
|
|
20
|
-
}
|
|
21
18
|
|
|
22
19
|
user
|
|
23
20
|
end
|
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_liana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sandro Munda
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|