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: 0d8c0675fe5c776a7168baf4e5375ead76bd8319b75c29c620e6888bbd9bfaec
4
- data.tar.gz: 5d20db5792e2b1a637545cfe4a024df625db72004671fb47fa3eb15c68801736
3
+ metadata.gz: 834c9124265c1aee37c5dfcb4bf61bf47f9e874b7491fc746d77f4a8ce2844e2
4
+ data.tar.gz: 469622daee20e8211a8808a2a1c6c574f130c9035c6d45cd1b4e6b462696e7f8
5
5
  SHA512:
6
- metadata.gz: 8de8c18b1b18b60f8d7096734e16a187a4e0d87cd9d5e00ef6fa70e7a8efb042bcbc08c084c33102c810c11da56402a8f77f554e4bbfbe4e9de60e3b3b90fdcf
7
- data.tar.gz: 9959a3a3a53996d7cfcf638f82c24b93a471a01cb6f7eb75e20c459711235e68ea3077c9d44a0d606f5e4a396a5739649945d26d617d1e16da58234e6e03454f
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
- array_query_request_info = @query_request_info.values.filter_map{ |x| x unless x.nil? }
180
+ array_permission_infos = @query_request_info.values.filter_map{ |x| x unless x.nil? }
181
181
 
182
- # NOTICE: pool_permissions contains the @query_request_info
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
- (array_query_request_info & statPermission.values) == array_query_request_info;
185
+ (array_permission_infos.all? { |info| statPermission.values.include?(info) });
187
186
  }
188
187
  end
189
188
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "6.3.4"
2
+ VERSION = "6.3.5"
3
3
  end
@@ -72,12 +72,14 @@ describe "Stats", type: :request do
72
72
  expect(response.status).to eq(404)
73
73
  end
74
74
 
75
- # it 'should respond 403 Forbidden' do
76
- # allow_any_instance_of(ForestLiana::PermissionsChecker).to receive(:is_authorized?) { false }
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
- # post '/forest/stats/Products', params: JSON.dump(params), headers: headers
79
- # expect(response.status).to eq(403)
80
- # end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.4
4
+ version: 6.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda