foreman_scc_manager 2.3.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/foreman_scc_manager/locale/de/foreman_scc_manager.js +592 -0
  4. data/app/assets/javascripts/foreman_scc_manager/locale/el/foreman_scc_manager.js +592 -0
  5. data/app/assets/javascripts/foreman_scc_manager/locale/en/foreman_scc_manager.js +592 -0
  6. data/app/assets/javascripts/foreman_scc_manager/locale/fr/foreman_scc_manager.js +592 -0
  7. data/app/assets/javascripts/foreman_scc_manager/locale/ja/foreman_scc_manager.js +592 -0
  8. data/app/assets/javascripts/foreman_scc_manager/locale/ka/foreman_scc_manager.js +592 -0
  9. data/app/assets/javascripts/foreman_scc_manager/locale/zh_CN/foreman_scc_manager.js +592 -0
  10. data/app/controllers/api/v2/scc_accounts_controller.rb +21 -17
  11. data/app/controllers/api/v2/scc_products_controller.rb +2 -2
  12. data/app/controllers/scc_accounts_controller.rb +14 -8
  13. data/app/lib/actions/scc_manager/subscribe_product.rb +14 -14
  14. data/app/lib/actions/scc_manager/sync_products.rb +6 -6
  15. data/app/lib/actions/scc_manager/sync_repositories.rb +5 -5
  16. data/app/models/scc_account.rb +2 -2
  17. data/app/models/scc_product.rb +4 -4
  18. data/app/views/api/v2/scc_products/main.json.rabl +1 -1
  19. data/db/migrate/20200520281300_fix_scc_permissions.rb +1 -1
  20. data/db/migrate/20210713092440_add_permissions.rb +1 -1
  21. data/db/migrate/20220429102717_populate_scc_katello_repositories.rb +1 -0
  22. data/lib/foreman_scc_manager/engine.rb +41 -46
  23. data/lib/foreman_scc_manager/version.rb +1 -1
  24. data/lib/tasks/rubocop.rake +2 -2
  25. data/lib/tasks/setup_authentication_token.rake +1 -1
  26. data/locale/Makefile +8 -10
  27. data/locale/fr/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  28. data/locale/fr/foreman_scc_manager.po +601 -0
  29. data/test/controllers/api/v2/scc_accounts_test.rb +21 -21
  30. data/test/controllers/scc_accounts_controller_test.rb +9 -9
  31. data/test/features/sync_test.rb +9 -9
  32. data/test/fixtures/models/scc_repositories.yml +1 -1
  33. data/test/models/scc_account_test.rb +3 -3
  34. data/test/models/scc_product_test.rb +1 -1
  35. data/test/support/fixtures_support.rb +1 -1
  36. data/test/test_plugin_helper.rb +4 -4
  37. data/webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/components/SCCRepoPicker/index.js +8 -8
  38. data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js +4 -4
  39. metadata +14 -20
  40. data/locale/action_names.rb +0 -88
@@ -0,0 +1,592 @@
1
+ locales['foreman_scc_manager'] = locales['foreman_scc_manager'] || {}; locales['foreman_scc_manager']['zh_CN'] = {
2
+ "domain": "foreman_scc_manager",
3
+ "locale_data": {
4
+ "foreman_scc_manager": {
5
+ "": {
6
+ "Project-Id-Version": "foreman_scc_manager 1.0.0",
7
+ "Report-Msgid-Bugs-To": "",
8
+ "PO-Revision-Date": "2019-10-17 13:28+0000",
9
+ "Last-Translator": "Amit Upadhye <aupadhye@redhat.com>, 2022",
10
+ "Language-Team": "Chinese (China) (https://www.transifex.com/foreman/teams/114/zh_CN/)",
11
+ "MIME-Version": "1.0",
12
+ "Content-Type": "text/plain; charset=UTF-8",
13
+ "Content-Transfer-Encoding": "8bit",
14
+ "Language": "zh_CN",
15
+ "Plural-Forms": "nplurals=1; plural=0;",
16
+ "lang": "zh_CN",
17
+ "domain": "foreman_scc_manager",
18
+ "plural_forms": "nplurals=1; plural=0;"
19
+ },
20
+ "List all scc_accounts": [
21
+ "列出所有 scc_accounts"
22
+ ],
23
+ "Show scc_account": [
24
+ "显示 scc_account"
25
+ ],
26
+ "Name of the scc_account": [
27
+ "scc_account 的名称"
28
+ ],
29
+ "Login id of scc_account": [
30
+ "scc_account 的登录 ID"
31
+ ],
32
+ "Password of scc_account": [
33
+ "scc_account 的密码"
34
+ ],
35
+ "URL of SUSE for scc_account": [
36
+ "scc_account 的 SUSE URL"
37
+ ],
38
+ "Interval for syncing scc_account": [
39
+ "同步 scc_account 的时间间隔"
40
+ ],
41
+ "The default download policy for repositories which were created using this SCC Account.": [
42
+ ""
43
+ ],
44
+ "The default mirroring policy for repositories which were created using this SCC Account.": [
45
+ ""
46
+ ],
47
+ "Date and time relative to which the sync interval is run": [
48
+ "运行同步间隔的日期和时间"
49
+ ],
50
+ "Associated GPG key of scc_account": [
51
+ "scc_account 的关联 GPG 密钥"
52
+ ],
53
+ "Create an scc_account": [
54
+ "创建 scc_account"
55
+ ],
56
+ "Update scc_account": [
57
+ "更新 scc_account"
58
+ ],
59
+ "Delete scc_account": [
60
+ "删除 scc_account"
61
+ ],
62
+ "Test connection for scc_account": [
63
+ "测试 scc_account 的连接"
64
+ ],
65
+ "Sync scc_account": [
66
+ "同步 scc_account"
67
+ ],
68
+ "Bulk subscription of scc_products for scc_account": [
69
+ "scc_account 的批量 scc_products 订阅"
70
+ ],
71
+ "Bulk subscription of scc_products with individual repository selection for scc_account.": [
72
+ ""
73
+ ],
74
+ "The selected products cannot be found for this SCC account.": [
75
+ ""
76
+ ],
77
+ "List products for an scc_account": [
78
+ ""
79
+ ],
80
+ "Show subscribed products only": [
81
+ ""
82
+ ],
83
+ "Show an scc_account product": [
84
+ "显示 scc_account 产品"
85
+ ],
86
+ "Subscribe product": [
87
+ "订阅产品"
88
+ ],
89
+ "Sync task started.": [
90
+ "同步任务已启动。"
91
+ ],
92
+ "Failed to add task to queue: %s": [
93
+ "向队列添加任务失败:%s"
94
+ ],
95
+ "Lock on SCC account already taken: %s": [
96
+ "锁定 SCC 帐户已采用:%s"
97
+ ],
98
+ "Task to subscribe products started.": [
99
+ "订阅产品的任务已开始。"
100
+ ],
101
+ "No products selected.": [
102
+ "没有选择产品."
103
+ ],
104
+ "Subscribe SCC Product": [
105
+ "订阅 SCC 产品"
106
+ ],
107
+ "Sync SUSE subscriptions": [
108
+ "同步 SUSE 订阅"
109
+ ],
110
+ "Update SUSE repositories %s": [
111
+ "更新 SUSE 仓库 %s"
112
+ ],
113
+ "Unknown": [
114
+ "未知"
115
+ ],
116
+ "Update SUSE repositories": [
117
+ "创建 SUSE 仓库"
118
+ ],
119
+ "Sync SUSE subscriptions (Products)": [
120
+ "同步 SUSE 订阅(产品)"
121
+ ],
122
+ "Sync SUSE subscriptions (Repositories)": [
123
+ "同步 SUSE 订阅(仓库)"
124
+ ],
125
+ "never synced": [
126
+ "从未同步"
127
+ ],
128
+ "Interval cannot be nil": [
129
+ "间隔不能为零"
130
+ ],
131
+ "Interval not set correctly": [
132
+ "间隔设置不正确"
133
+ ],
134
+ "Cron expression is not valid!": [
135
+ "Cron 表达式无效!"
136
+ ],
137
+ "On Demand": [
138
+ ""
139
+ ],
140
+ "Immediate": [
141
+ ""
142
+ ],
143
+ "Additive": [
144
+ ""
145
+ ],
146
+ "Content Only": [
147
+ ""
148
+ ],
149
+ "SUSE Subscription": [
150
+ "SUSE 订阅"
151
+ ],
152
+ "SUSE Subscription: ": [
153
+ "SUSE 订阅:"
154
+ ],
155
+ "SUSE Customer Center account": [
156
+ "SUSE 客户中心帐户"
157
+ ],
158
+ "Use your 'Organization credentials' obtained from the SUSE Customer Center.": [
159
+ "使用从 SUSE 客户中心获取的\\\"组织凭据\\\"。"
160
+ ],
161
+ "Base URL": [
162
+ "基本 URL"
163
+ ],
164
+ "Sync interval": [
165
+ "同步间隔"
166
+ ],
167
+ "The sync interval is used to periodically update the SCC authentication tokens of any imported products.": [
168
+ "同步间隔用于定期更新任何导入产品的 SCC 身份验证令牌。"
169
+ ],
170
+ "Sync Date": [
171
+ "同步日期"
172
+ ],
173
+ "None": [
174
+ "没有"
175
+ ],
176
+ "Use GPG key for SUSE products": [
177
+ "将 GPG 密钥用于 SUSE 产品"
178
+ ],
179
+ "Use this setting if you want to automatically add a GPG key to your SUSE products upon subscription. You can change this setting in the 'Content' > 'Products' menu, later.": [
180
+ "如果要在订阅时自动在 SUSE 产品中添加 GPG 密钥,请使用这个设置。稍后,您可以在 'Content' > 'Products' 菜单中更改此设置。"
181
+ ],
182
+ "Download Policy": [
183
+ ""
184
+ ],
185
+ "Mirroring Policy": [
186
+ ""
187
+ ],
188
+ "Test Connection": [
189
+ "测试连接"
190
+ ],
191
+ "Edit %s": [
192
+ "编辑 %s"
193
+ ],
194
+ "SUSE subscriptions": [
195
+ "SUSE 订阅"
196
+ ],
197
+ "Add SCC account": [
198
+ "添加 SCC 帐户"
199
+ ],
200
+ "Products": [
201
+ "产品"
202
+ ],
203
+ "Last synced": [
204
+ "最后同步的"
205
+ ],
206
+ "Actions": [
207
+ "操作"
208
+ ],
209
+ "Select products": [
210
+ "选择产品"
211
+ ],
212
+ "Sync": [
213
+ "同步"
214
+ ],
215
+ "WARNING: If you want to switch SCC accounts and retain the synchronized content, DO NOT delete your old SCC account, even if it is expired. Please change the login and password of your SCC account, instead.\\n\\nIf you delete your old SCC account, you CANNOT reuse existing repositories, products, content views, and composite content views.\\n\\nReally delete SCC account %s?": [
216
+ ""
217
+ ],
218
+ "Add SUSE Customer Center Account": [
219
+ "添加 SUSE 客户中心帐户"
220
+ ],
221
+ "Product Selection for Account %s": [
222
+ "为帐户 %s 选择产品"
223
+ ],
224
+ "SUSE Subscriptions": [
225
+ "SUSE 订阅"
226
+ ],
227
+ "Please synchronize your SUSE account before you can subscribe to SUSE products.": [
228
+ ""
229
+ ],
230
+ "SUSE Customer Center": [
231
+ "SUSE 客户中心"
232
+ ],
233
+ "Synchronize SUSE Account": [
234
+ ""
235
+ ],
236
+ "The subscription task has been started successfully": [
237
+ ""
238
+ ],
239
+ "Starting the subscription task failed.": [
240
+ ""
241
+ ],
242
+ "Failed to add task to queue.": [
243
+ ""
244
+ ],
245
+ "%s/%s": [
246
+ ""
247
+ ],
248
+ "Filter repositories": [
249
+ ""
250
+ ],
251
+ "If this option is enabled, debug and source pool repositories are automatically selected if you select a product. This option is disabled by default. It applies for unselected products, only. Already selected products are not filtered.": [
252
+ ""
253
+ ],
254
+ "Include Debug and Source Pool repositories": [
255
+ ""
256
+ ],
257
+ "Add product(s)": [
258
+ ""
259
+ ],
260
+ " -- Select Product --": [
261
+ ""
262
+ ],
263
+ " -- Select Version --": [
264
+ ""
265
+ ],
266
+ " -- Select Architecture --": [
267
+ ""
268
+ ],
269
+ "Select SUSE products": [
270
+ ""
271
+ ],
272
+ "Search": [
273
+ ""
274
+ ],
275
+ "Reset Selection": [
276
+ ""
277
+ ],
278
+ "Summary of SCC product subscription": [
279
+ ""
280
+ ],
281
+ "The subscription task with id ": [
282
+ ""
283
+ ],
284
+ " has started successfully.": [
285
+ ""
286
+ ],
287
+ "The following products will be imported:": [
288
+ ""
289
+ ],
290
+ "Go to Repository page": [
291
+ ""
292
+ ],
293
+ "Repository not imported": [
294
+ ""
295
+ ],
296
+ "Please check your SUSE subscription": [
297
+ ""
298
+ ],
299
+ "Repositories (%s/%s)": [
300
+ ""
301
+ ],
302
+ "Go to Product page": [
303
+ ""
304
+ ],
305
+ "Add more sub products to Product tree": [
306
+ ""
307
+ ],
308
+ "Show currently added repositories": [
309
+ ""
310
+ ],
311
+ "Selected SUSE Products": [
312
+ ""
313
+ ],
314
+ "You currently have no SUSE products selected. Search and add SUSE products in the section below.": [
315
+ ""
316
+ ],
317
+ "Show all subscription tasks": [
318
+ ""
319
+ ],
320
+ "Show last product subscription task": [
321
+ ""
322
+ ],
323
+ "Expand products": [
324
+ ""
325
+ ],
326
+ "Collapse products": [
327
+ ""
328
+ ],
329
+ "Collapse/Expand": [
330
+ ""
331
+ ],
332
+ "Show all products": [
333
+ ""
334
+ ],
335
+ "Show only subscribed products": [
336
+ ""
337
+ ],
338
+ "Show/Hide unsubscribed": [
339
+ ""
340
+ ],
341
+ "Import": [
342
+ ""
343
+ ],
344
+ "Export Repository": [
345
+ ""
346
+ ],
347
+ "Export Library": [
348
+ ""
349
+ ],
350
+ "Generate host applicability": [
351
+ ""
352
+ ],
353
+ "Bulk generate applicability for hosts": [
354
+ ""
355
+ ],
356
+ "Generate repository applicability": [
357
+ ""
358
+ ],
359
+ "Synchronize smart proxy": [
360
+ ""
361
+ ],
362
+ "Sync capsule": [
363
+ ""
364
+ ],
365
+ "Update CDN Configuration": [
366
+ ""
367
+ ],
368
+ "Update": [
369
+ ""
370
+ ],
371
+ "Delete": [
372
+ ""
373
+ ],
374
+ "Errata mail": [
375
+ ""
376
+ ],
377
+ "Incremental Update of Content View Version(s) ": [
378
+ ""
379
+ ],
380
+ "Import facts": [
381
+ ""
382
+ ],
383
+ "Import Puppet classes": [
384
+ ""
385
+ ],
386
+ "Abstract async task": [
387
+ ""
388
+ ],
389
+ "Syncable export": [
390
+ ""
391
+ ],
392
+ "Export": [
393
+ ""
394
+ ],
395
+ "Copy version units to library": [
396
+ ""
397
+ ],
398
+ "Create Syncable Export History": [
399
+ ""
400
+ ],
401
+ "Create Import History": [
402
+ ""
403
+ ],
404
+ "Create": [
405
+ ""
406
+ ],
407
+ "Delete Activation Key": [
408
+ ""
409
+ ],
410
+ "Create Export History": [
411
+ ""
412
+ ],
413
+ "Agent action": [
414
+ ""
415
+ ],
416
+ "Create Alternate Content Source": [
417
+ ""
418
+ ],
419
+ "Destroy Alternate Content Source": [
420
+ ""
421
+ ],
422
+ "Refresh Alternate Content Source": [
423
+ ""
424
+ ],
425
+ "Update Alternate Content Source": [
426
+ ""
427
+ ],
428
+ "Action with sub plans": [
429
+ ""
430
+ ],
431
+ "Abstract": [
432
+ ""
433
+ ],
434
+ "Remove from Environment": [
435
+ ""
436
+ ],
437
+ "Promote": [
438
+ ""
439
+ ],
440
+ "Promotion to Environment": [
441
+ ""
442
+ ],
443
+ "Publish": [
444
+ ""
445
+ ],
446
+ "Remove Versions and Associations": [
447
+ ""
448
+ ],
449
+ "Remove Version": [
450
+ ""
451
+ ],
452
+ "Import Content View Version": [
453
+ ""
454
+ ],
455
+ "Import Default Content View": [
456
+ ""
457
+ ],
458
+ "Import Repository": [
459
+ ""
460
+ ],
461
+ "Incremental Update": [
462
+ ""
463
+ ],
464
+ "Republish Version Repositories": [
465
+ ""
466
+ ],
467
+ "Delete Lifecycle Environment": [
468
+ ""
469
+ ],
470
+ "Publish Lifecycle Environment Repositories": [
471
+ ""
472
+ ],
473
+ "Attach subscriptions": [
474
+ ""
475
+ ],
476
+ "Auto attach subscriptions": [
477
+ ""
478
+ ],
479
+ "Destroy Content Host": [
480
+ ""
481
+ ],
482
+ "Install Applicable Errata": [
483
+ ""
484
+ ],
485
+ "Hypervisors": [
486
+ ""
487
+ ],
488
+ "Hypervisors update": [
489
+ ""
490
+ ],
491
+ "Remove subscriptions": [
492
+ ""
493
+ ],
494
+ "Combined Profile Update": [
495
+ ""
496
+ ],
497
+ "Update Content Overrides": [
498
+ ""
499
+ ],
500
+ "Update for host": [
501
+ ""
502
+ ],
503
+ "Update release version for host": [
504
+ ""
505
+ ],
506
+ "Updating System Purpose for host": [
507
+ ""
508
+ ],
509
+ "Package Profile Update": [
510
+ ""
511
+ ],
512
+ "Destroy": [
513
+ ""
514
+ ],
515
+ "Run Sync Plan:": [
516
+ ""
517
+ ],
518
+ "Enable": [
519
+ ""
520
+ ],
521
+ "Disable": [
522
+ ""
523
+ ],
524
+ "Verify checksum": [
525
+ ""
526
+ ],
527
+ "Create Package Group": [
528
+ ""
529
+ ],
530
+ "Upload into": [
531
+ ""
532
+ ],
533
+ "Update redhat repository": [
534
+ ""
535
+ ],
536
+ "Update http proxy details": [
537
+ ""
538
+ ],
539
+ "Update content urls": [
540
+ ""
541
+ ],
542
+ "Discover": [
543
+ ""
544
+ ],
545
+ "Synchronize": [
546
+ ""
547
+ ],
548
+ "Remove Content": [
549
+ ""
550
+ ],
551
+ "Instance update": [
552
+ ""
553
+ ],
554
+ "Index package groups": [
555
+ ""
556
+ ],
557
+ "Index module streams": [
558
+ ""
559
+ ],
560
+ "Index errata": [
561
+ ""
562
+ ],
563
+ "Index content": [
564
+ ""
565
+ ],
566
+ "Filtered index content": [
567
+ ""
568
+ ],
569
+ "Fetch pxe files": [
570
+ ""
571
+ ],
572
+ "Delete Package Group": [
573
+ ""
574
+ ],
575
+ "Update http proxy": [
576
+ ""
577
+ ],
578
+ "Reindex subscriptions": [
579
+ ""
580
+ ],
581
+ "Delete Product": [
582
+ ""
583
+ ],
584
+ "Product Create": [
585
+ ""
586
+ ],
587
+ "Foreman plugin to sync SUSE Customer Center products and repositories into Katello.": [
588
+ "Foreman 插件,将 SUSE 客户中心产品和存储库同步到 Katello。"
589
+ ]
590
+ }
591
+ }
592
+ };
@@ -23,8 +23,8 @@ module Api
23
23
 
24
24
  api :GET, '/scc_accounts/:id/', N_('Show scc_account')
25
25
  param :id, :identifier_dottable, :required => true
26
- param :organization_id, :identifier, :required => true
27
- def show; end
26
+ def show
27
+ end
28
28
 
29
29
  def_param_group :scc_account do
30
30
  param :scc_account, Hash, :required => true, :action_aware => true do
@@ -35,13 +35,13 @@ module Api
35
35
  param :base_url, String, :required => false, :desc => N_('URL of SUSE for scc_account')
36
36
  param :interval, ['never', 'daily', 'weekly', 'monthly'], :desc => N_('Interval for syncing scc_account')
37
37
  param :download_policy,
38
- ::Katello::RootRepository::DOWNLOAD_POLICIES,
39
- :required => false,
40
- :desc => N_('The default download policy for repositories which were created using this SCC Account.')
38
+ ::Katello::RootRepository::DOWNLOAD_POLICIES,
39
+ :required => false,
40
+ :desc => N_('The default download policy for repositories which were created using this SCC Account.')
41
41
  param :mirroring_policy,
42
- SccAccount::SCC_MIRRORING_POLICIES,
43
- :required => false,
44
- :desc => N_('The default mirroring policy for repositories which were created using this SCC Account.')
42
+ SccAccount::SCC_MIRRORING_POLICIES,
43
+ :required => false,
44
+ :desc => N_('The default mirroring policy for repositories which were created using this SCC Account.')
45
45
  param :sync_date, String, :desc => N_('Date and time relative to which the sync interval is run')
46
46
  param :katello_gpg_key_id, :identifier, :required => false, :desc => N_('Associated GPG key of scc_account')
47
47
  end
@@ -58,7 +58,11 @@ module Api
58
58
  param :id, :identifier_dottable, :required => true
59
59
  param_group :scc_account
60
60
  def update
61
- process_response @scc_account.update(scc_account_params)
61
+ if params[:scc_account].present?
62
+ process_response @scc_account.update(scc_account_params)
63
+ else
64
+ render json: { error: 'No input data provided for changing the SCC account.', status: :expectation_failed }
65
+ end
62
66
  end
63
67
 
64
68
  api :DELETE, '/scc_accounts/:id', N_('Delete scc_account')
@@ -120,9 +124,9 @@ module Api
120
124
  # if the id array is empty, all repositories will be subscribed to
121
125
  scc_products = @scc_account.scc_products.where(:id => params[:scc_subscribe_product_ids])
122
126
  subscribe_task = ForemanTasks.async_task(::Actions::BulkAction,
123
- ::Actions::SccManager::SubscribeProduct,
124
- scc_products,
125
- {})
127
+ ::Actions::SccManager::SubscribeProduct,
128
+ scc_products,
129
+ {})
126
130
  format.json { render json: subscribe_task.to_json, status: :ok }
127
131
  else
128
132
  format.json { render json: { error: 'No Product selected' }, status: :expectation_failed }
@@ -137,8 +141,8 @@ module Api
137
141
  def_param_group :scc_product_data do
138
142
  param :scc_product_data, Array, :required => true, :desc => 'Array of Hash elements. One hash element contains an scc_product_id and a repository_list.' do
139
143
  param :scc_product_id, Integer, :required => true, :desc => 'Product ID of SCC product'
140
- param :repository_list, Array, of: Integer, :required => false,
141
- :desc => 'List of SCC repositories belonging to the SCC product. If the list is empty, all repositories will be subscribed to.'
144
+ param :repository_list, Array, of: Integer, required: false,
145
+ desc: 'List of SCC repositories belonging to the SCC product. If the list is empty, all repositories will be subscribed to.'
142
146
  end
143
147
  end
144
148
 
@@ -156,9 +160,9 @@ module Api
156
160
  else
157
161
  action_args = params[:scc_product_data].map { |p| { p['scc_product_id'] => p['repository_list'] } }.inject(:merge)
158
162
  subscribe_task = ForemanTasks.async_task(::Actions::BulkAction,
159
- ::Actions::SccManager::SubscribeProduct,
160
- scc_products,
161
- action_args)
163
+ ::Actions::SccManager::SubscribeProduct,
164
+ scc_products,
165
+ action_args)
162
166
  format.json { render json: subscribe_task.to_json, status: :ok }
163
167
  end
164
168
  else
@@ -28,14 +28,14 @@ module Api
28
28
  def index
29
29
  scope = resource_scope
30
30
  scope = scope.where.not(:product_id => nil) if ::Foreman::Cast.to_bool(params[:subscribed_only])
31
- scope = scope.where(:organization => params[:organization_id]) if params[:organization_id].present?
32
31
  @scc_products = scope.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page])
33
32
  end
34
33
 
35
34
  api :GET, '/scc_accounts/:scc_account_id/scc_products/:id/', N_('Show an scc_account product')
36
35
  param :id, :identifier_dottable, :required => true
37
36
  param :scc_account_id, :identifier_dottable, :required => true
38
- def show; end
37
+ def show
38
+ end
39
39
 
40
40
  api :PUT, '/scc_accounts/:scc_account_id/scc_products/:id/subscribe/', N_('Subscribe product')
41
41
  param :id, :identifier_dottable, :required => true