forest_liana 6.3.4 → 6.3.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 834c9124265c1aee37c5dfcb4bf61bf47f9e874b7491fc746d77f4a8ce2844e2
|
4
|
+
data.tar.gz: 469622daee20e8211a8808a2a1c6c574f130c9035c6d45cd1b4e6b462696e7f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b1530018ef75a9621156626e13af9b7f0b41b0b555a9dbb6c4e7bafa2cdab1abe6641bc51e45f9c13fc29fe11ba6007f6d2f697f9f9763fe11c5e7120e4db05
|
7
|
+
data.tar.gz: 3c4e5fcce7f49d40e4e0ca18b385bf152df88675408add741acca22180c773e446730107fc5c1adf09cc70db5da98f978068267fbeddef1ff8b8627c18c36346
|
@@ -89,6 +89,11 @@ module ForestLiana
|
|
89
89
|
parameters.delete('controller');
|
90
90
|
parameters.delete('action');
|
91
91
|
|
92
|
+
# NOTICE: Remove the field information from group_by_field => collection:id
|
93
|
+
if parameters['group_by_field']
|
94
|
+
parameters['group_by_field'] = parameters['group_by_field'].split(':').first
|
95
|
+
end
|
96
|
+
|
92
97
|
return parameters;
|
93
98
|
end
|
94
99
|
|
@@ -177,13 +177,12 @@ module ForestLiana
|
|
177
177
|
return false unless pool_permissions
|
178
178
|
|
179
179
|
# NOTICE: equivalent to Object.values in js & removes nil values
|
180
|
-
|
180
|
+
array_permission_infos = @query_request_info.values.filter_map{ |x| x unless x.nil? }
|
181
181
|
|
182
|
-
# NOTICE: pool_permissions
|
183
|
-
# we use the intersection between statPermission and @query_request_info
|
182
|
+
# NOTICE: Is there any pool_permissions containing the array_permission_infos
|
184
183
|
return pool_permissions.any? {
|
185
184
|
|statPermission|
|
186
|
-
(
|
185
|
+
(array_permission_infos.all? { |info| statPermission.values.include?(info) });
|
187
186
|
}
|
188
187
|
end
|
189
188
|
|
data/lib/forest_liana/version.rb
CHANGED
data/spec/requests/stats_spec.rb
CHANGED
@@ -72,12 +72,14 @@ describe "Stats", type: :request do
|
|
72
72
|
expect(response.status).to eq(404)
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
|
75
|
+
it 'should respond 403 Forbidden' do
|
76
|
+
allow_any_instance_of(ForestLiana::PermissionsChecker).to receive(:is_authorized?) { false }
|
77
|
+
# NOTICE: bypass : find_resource error
|
78
|
+
allow_any_instance_of(ForestLiana::StatsController).to receive(:find_resource) { true }
|
77
79
|
|
78
|
-
|
79
|
-
|
80
|
-
|
80
|
+
post '/forest/stats/Products', params: JSON.dump(params), headers: headers
|
81
|
+
expect(response.status).to eq(403)
|
82
|
+
end
|
81
83
|
end
|
82
84
|
|
83
85
|
describe 'POST /stats' do
|