katello 3.17.0 → 3.18.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
  5. data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
  6. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
  7. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
  8. data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
  9. data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
  10. data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
  11. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
  12. data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
  13. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
  14. data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
  15. data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
  16. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
  17. data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
  18. data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
  19. data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
  20. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
  21. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
  22. data/app/controllers/katello/api/v2/products_controller.rb +9 -9
  23. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
  24. data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
  25. data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
  26. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
  27. data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
  28. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
  29. data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
  30. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
  31. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
  32. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
  33. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
  34. data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
  35. data/app/helpers/katello/katello_urls_helper.rb +5 -2
  36. data/app/lib/actions/candlepin/product/content_create.rb +2 -0
  37. data/app/lib/actions/candlepin/product/content_update.rb +2 -0
  38. data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
  39. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
  40. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  41. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
  42. data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
  43. data/app/lib/actions/katello/content_view/publish.rb +9 -9
  44. data/app/lib/actions/katello/content_view_version/import.rb +8 -13
  45. data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
  46. data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
  47. data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
  48. data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
  49. data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
  50. data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
  51. data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
  52. data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
  53. data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
  54. data/app/lib/actions/katello/product/content_create.rb +7 -6
  55. data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
  56. data/app/lib/actions/katello/repository/import_upload.rb +4 -1
  57. data/app/lib/actions/katello/repository/remove_content.rb +1 -1
  58. data/app/lib/actions/katello/repository/sync.rb +3 -1
  59. data/app/lib/actions/katello/repository/update.rb +5 -1
  60. data/app/lib/actions/katello/repository/upload_files.rb +1 -0
  61. data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
  62. data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
  63. data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
  64. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
  65. data/app/lib/actions/pulp3/content_migration.rb +10 -0
  66. data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
  67. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
  68. data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
  69. data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
  70. data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
  71. data/app/lib/actions/pulp3/import_migration.rb +6 -1
  72. data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
  73. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
  74. data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
  75. data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
  76. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
  77. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
  78. data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
  79. data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
  80. data/app/lib/actions/pulp3/repository/delete.rb +1 -1
  81. data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
  82. data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
  83. data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
  84. data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
  85. data/app/lib/katello/resources/candlepin/owner.rb +5 -0
  86. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
  87. data/app/lib/katello/resources/registry.rb +3 -3
  88. data/app/models/katello/authorization/activation_key.rb +4 -0
  89. data/app/models/katello/authorization/content_view.rb +13 -0
  90. data/app/models/katello/authorization/content_view_component.rb +15 -0
  91. data/app/models/katello/authorization/content_view_filter.rb +15 -0
  92. data/app/models/katello/authorization/content_view_version.rb +25 -2
  93. data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
  94. data/app/models/katello/authorization/gpg_key.rb +12 -4
  95. data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
  96. data/app/models/katello/authorization/organization.rb +8 -0
  97. data/app/models/katello/authorization/sync_plan.rb +16 -0
  98. data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
  99. data/app/models/katello/concerns/organization_extensions.rb +4 -5
  100. data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
  101. data/app/models/katello/content_migration_progress.rb +4 -0
  102. data/app/models/katello/content_view.rb +30 -4
  103. data/app/models/katello/content_view_component.rb +2 -0
  104. data/app/models/katello/content_view_filter.rb +5 -0
  105. data/app/models/katello/content_view_history.rb +2 -1
  106. data/app/models/katello/content_view_package_filter.rb +1 -1
  107. data/app/models/katello/content_view_puppet_module.rb +8 -0
  108. data/app/models/katello/content_view_repository.rb +13 -1
  109. data/app/models/katello/content_view_version_export_history.rb +8 -1
  110. data/app/models/katello/glue/candlepin/pool.rb +9 -14
  111. data/app/models/katello/glue/pulp/repo.rb +8 -0
  112. data/app/models/katello/gpg_key.rb +1 -1
  113. data/app/models/katello/ping.rb +8 -3
  114. data/app/models/katello/repository.rb +33 -0
  115. data/app/models/katello/root_repository.rb +26 -1
  116. data/app/models/katello/smart_proxy_sync_history.rb +8 -0
  117. data/app/services/katello/candlepin/event_handler.rb +2 -0
  118. data/app/services/katello/candlepin/message_handler.rb +34 -0
  119. data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
  120. data/app/services/katello/host_status_manager.rb +9 -0
  121. data/app/services/katello/pulp3/api/apt.rb +57 -0
  122. data/app/services/katello/pulp3/api/core.rb +8 -0
  123. data/app/services/katello/pulp3/api/docker.rb +4 -0
  124. data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
  125. data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
  126. data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
  127. data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
  128. data/app/services/katello/pulp3/deb.rb +38 -0
  129. data/app/services/katello/pulp3/docker_manifest.rb +1 -0
  130. data/app/services/katello/pulp3/docker_tag.rb +1 -0
  131. data/app/services/katello/pulp3/migration.rb +51 -10
  132. data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
  133. data/app/services/katello/pulp3/repository.rb +10 -4
  134. data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
  135. data/app/services/katello/pulp3/repository/apt.rb +63 -0
  136. data/app/services/katello/pulp3/repository/docker.rb +9 -0
  137. data/app/services/katello/pulp3/repository/yum.rb +14 -9
  138. data/app/services/katello/pulp3/repository_mirror.rb +9 -4
  139. data/app/services/katello/pulp3/task.rb +4 -0
  140. data/app/services/katello/pulp3/task_group.rb +4 -0
  141. data/app/services/katello/repository_type.rb +2 -1
  142. data/app/services/katello/smart_proxy_helper.rb +9 -0
  143. data/app/views/dashboard/_subscription_widget.html.erb +0 -5
  144. data/app/views/foreman/hosts/_registration.html.erb +12 -0
  145. data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
  146. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  147. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  148. data/app/views/katello/layouts/react.html.erb +3 -2
  149. data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
  150. data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
  151. data/config/routes/api/v2.rb +24 -2
  152. data/config/routes/overrides.rb +1 -0
  153. data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
  154. data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
  155. data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
  156. data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
  157. data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
  158. data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
  159. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  160. data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
  161. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
  199. data/lib/katello/engine.rb +2 -0
  200. data/lib/katello/permission_creator.rb +98 -69
  201. data/lib/katello/permissions/host_permissions.rb +1 -0
  202. data/lib/katello/plugin.rb +10 -2
  203. data/lib/katello/repository_types/deb.rb +9 -1
  204. data/lib/katello/tasks/pulp3_migration.rake +17 -3
  205. data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
  206. data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
  207. data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
  208. data/lib/katello/tasks/reset.rake +2 -1
  209. data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
  210. data/lib/katello/version.rb +1 -1
  211. data/locale/action_names.rb +51 -44
  212. data/locale/bn/katello.po +279 -55
  213. data/locale/cs/katello.po +278 -51
  214. data/locale/de/katello.po +279 -52
  215. data/locale/en/katello.po +278 -49
  216. data/locale/es/katello.po +279 -51
  217. data/locale/fr/katello.po +279 -51
  218. data/locale/gu/katello.po +279 -55
  219. data/locale/hi/katello.po +279 -55
  220. data/locale/it/katello.po +279 -51
  221. data/locale/ja/katello.po +279 -52
  222. data/locale/katello.pot +1379 -971
  223. data/locale/kn/katello.po +279 -55
  224. data/locale/ko/katello.po +279 -51
  225. data/locale/mr/katello.po +279 -55
  226. data/locale/or/katello.po +279 -55
  227. data/locale/pa/katello.po +279 -55
  228. data/locale/pt/katello.po +278 -52
  229. data/locale/pt_BR/katello.po +279 -51
  230. data/locale/ru/katello.po +279 -51
  231. data/locale/ta/katello.po +279 -55
  232. data/locale/te/katello.po +279 -55
  233. data/locale/zh_CN/katello.po +279 -51
  234. data/locale/zh_TW/katello.po +279 -52
  235. data/webpack/components/ActionableDetail.js +2 -1
  236. data/webpack/components/Search/Search.js +1 -1
  237. data/webpack/components/Table/MainTable.js +6 -2
  238. data/webpack/components/Table/TableWrapper.js +46 -9
  239. data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
  240. data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
  241. data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
  242. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
  243. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
  244. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  245. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
  246. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
  247. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
  248. data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
  249. data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
  250. data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
  251. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
  252. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
  253. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
  254. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
  255. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
  256. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
  257. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
  258. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
  259. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
  260. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
  261. data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
  262. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
  263. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
  264. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
  265. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  266. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
  267. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
  268. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
  269. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
  270. data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
  271. metadata +74 -13
  272. data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -36,14 +36,29 @@
36
36
  <h4 translate>Sync Settings</h4>
37
37
  <dl class="dl-horizontal dl-horizontal-left">
38
38
  <span ng-show="repository.content_type === 'yum'" >
39
- <dt translate>Restrict to architecture</dt>
40
- <dd bst-edit-select="repository.arch==='noarch'?'Default':repository.arch"
39
+ <dt>
40
+ <span translate>Restrict to architecture</span>
41
+ <i class="pficon-info" title="{{ 'The repository will be enabled by default on content hosts with the selected architecture.' | translate }}"></i>
42
+ </dt>
43
+ <dd bst-edit-select="repository.arch==='noarch'?'No restriction':repository.arch"
41
44
  selector="repository.arch"
42
45
  options="architectures()"
43
46
  on-save="save(repository)">
44
47
  </dd>
45
48
  </span>
46
49
 
50
+ <span ng-show="repository.content_type === 'yum'" >
51
+ <dt>
52
+ <span translate>Restrict to <br />OS version</span>
53
+ <i class="pficon-info" title="{{ 'The repository will be enabled by default on content hosts with the selected OS version.' | translate }}"></i>
54
+ </dt>
55
+ <dd bst-edit-select="repository.os_versions.length ? formatOSVersions() : 'No restriction'"
56
+ selector="selectedOSVersion"
57
+ options="osVersionsOptions()"
58
+ on-save="save(repository)">
59
+ </dd>
60
+ </span>
61
+
47
62
  <dt ng-show="repository.content_type !== 'docker'" translate>Upstream URL</dt>
48
63
  <dt ng-show="repository.content_type === 'docker'" translate>Registry URL</dt>
49
64
  <dd bst-edit-text="repository.url"
@@ -17,6 +17,7 @@
17
17
  * @requires OstreeUpstreamSyncPolicy
18
18
  * @requires Architecture
19
19
  * @requires RepositoryTypesService
20
+ * @requires OSVersions
20
21
  * @requires YumContentUnits
21
22
  * #requires HttpProxyPolicy
22
23
  *
@@ -24,118 +25,121 @@
24
25
  * Controls the creation of an empty Repository object for use by sub-controllers.
25
26
  */
26
27
  angular.module('Bastion.repositories').controller('NewRepositoryController',
27
- ['$scope', '$sce', 'Repository', 'Product', 'ContentCredential', 'FormUtils', 'translate', 'Notification', 'ApiErrorHandler', 'BastionConfig', 'Checksum', 'YumContentUnits', 'DownloadPolicy', 'OstreeUpstreamSyncPolicy', 'Architecture', 'RepositoryTypesService', 'HttpProxy', 'HttpProxyPolicy',
28
- function ($scope, $sce, Repository, Product, ContentCredential, FormUtils, translate, Notification, ApiErrorHandler, BastionConfig, Checksum, YumContentUnits, DownloadPolicy, OstreeUpstreamSyncPolicy, Architecture, RepositoryTypesService, HttpProxy, HttpProxyPolicy) {
29
-
30
- function success() {
31
- Notification.setSuccessMessage(translate('Repository %s successfully created.').replace('%s', $scope.repository.name));
32
- $scope.transitionTo('product.repositories', {productId: $scope.$stateParams.productId});
33
- }
34
-
35
- function error(response) {
36
- var foundError = false;
37
- $scope.working = false;
38
-
39
- angular.forEach($scope.repositoryForm, function (field) {
40
- if ($scope.repositoryForm.hasOwnProperty(field) && field.hasOwnProperty('$modelValue')) {
41
- field.$setValidity('server', true);
42
- $scope.repositoryForm[field].$error.messages = [];
28
+ ['$scope', '$sce', 'Repository', 'Product', 'ContentCredential', 'FormUtils', 'translate', 'Notification', 'ApiErrorHandler', 'BastionConfig', 'Checksum', 'YumContentUnits', 'DownloadPolicy', 'OstreeUpstreamSyncPolicy', 'Architecture', 'RepositoryTypesService', 'HttpProxy', 'HttpProxyPolicy', 'OSVersions',
29
+ function ($scope, $sce, Repository, Product, ContentCredential, FormUtils, translate, Notification, ApiErrorHandler, BastionConfig, Checksum, YumContentUnits, DownloadPolicy, OstreeUpstreamSyncPolicy, Architecture, RepositoryTypesService, HttpProxy, HttpProxyPolicy, OSVersions) {
30
+
31
+ function success() {
32
+ Notification.setSuccessMessage(translate('Repository %s successfully created.').replace('%s', $scope.repository.name));
33
+ $scope.transitionTo('product.repositories', {productId: $scope.$stateParams.productId});
34
+ }
35
+
36
+ function error(response) {
37
+ var foundError = false;
38
+ $scope.working = false;
39
+
40
+ angular.forEach($scope.repositoryForm, function (field) {
41
+ if ($scope.repositoryForm.hasOwnProperty(field) && field.hasOwnProperty('$modelValue')) {
42
+ field.$setValidity('server', true);
43
+ $scope.repositoryForm[field].$error.messages = [];
44
+ }
45
+ });
46
+
47
+ angular.forEach(response.data.errors, function (errors, field) {
48
+ if ($scope.repositoryForm.hasOwnProperty(field)) {
49
+ foundError = true;
50
+ $scope.repositoryForm[field].$setValidity('server', false);
51
+ $scope.repositoryForm[field].$error.messages = errors;
52
+ }
53
+ });
54
+
55
+ if (!foundError) {
56
+ Notification.setErrorMessage(response.data.displayMessage);
43
57
  }
58
+ }
59
+
60
+ $scope.page = {
61
+ error: false,
62
+ loading: true
63
+ };
64
+
65
+ $scope.repository = new Repository({'product_id': $scope.$stateParams.productId, unprotected: true,
66
+ 'checksum_type': null, 'mirror_on_sync': true, 'verify_ssl_on_sync': true,
67
+ 'download_policy': BastionConfig.defaultDownloadPolicy, 'arch': null,
68
+ 'ostree_upstream_sync_policy': 'latest'});
69
+
70
+ $scope.product = Product.get({id: $scope.$stateParams.productId}, function () {
71
+ $scope.page.loading = false;
72
+ }, function (response) {
73
+ $scope.page.loading = false;
74
+ ApiErrorHandler.handleGETRequestErrors(response, $scope);
44
75
  });
45
76
 
46
- angular.forEach(response.data.errors, function (errors, field) {
47
- if ($scope.repositoryForm.hasOwnProperty(field)) {
48
- foundError = true;
49
- $scope.repositoryForm[field].$setValidity('server', false);
50
- $scope.repositoryForm[field].$error.messages = errors;
77
+ $scope.repositoryTypes = RepositoryTypesService.creatable();
78
+ $scope.repositoryTypes = _.sortBy($scope.repositoryTypes, 'name');
79
+
80
+ $scope.checksums = Checksum.checksums;
81
+ $scope.downloadPolicies = DownloadPolicy.downloadPolicies;
82
+ $scope.ostreeUpstreamSyncPolicies = OstreeUpstreamSyncPolicy.syncPolicies;
83
+ $scope.ignorableYumContentUnits = YumContentUnits.units;
84
+
85
+ $scope.$watch('repository.name', function () {
86
+ if ($scope.repositoryForm && $scope.repositoryForm.name) {
87
+ $scope.repositoryForm.name.$setValidity('server', true);
88
+ FormUtils.labelize($scope.repository);
51
89
  }
52
90
  });
53
91
 
54
- if (!foundError) {
55
- Notification.setErrorMessage(response.data.displayMessage);
56
- }
57
- }
58
-
59
- $scope.page = {
60
- error: false,
61
- loading: true
62
- };
63
-
64
- $scope.repository = new Repository({'product_id': $scope.$stateParams.productId, unprotected: true,
65
- 'checksum_type': null, 'mirror_on_sync': true, 'verify_ssl_on_sync': true,
66
- 'download_policy': BastionConfig.defaultDownloadPolicy, 'arch': null,
67
- 'ostree_upstream_sync_policy': 'latest'});
68
-
69
- $scope.product = Product.get({id: $scope.$stateParams.productId}, function () {
70
- $scope.page.loading = false;
71
- }, function (response) {
72
- $scope.page.loading = false;
73
- ApiErrorHandler.handleGETRequestErrors(response, $scope);
74
- });
75
-
76
- $scope.repositoryTypes = RepositoryTypesService.creatable();
77
- $scope.repositoryTypes = _.sortBy($scope.repositoryTypes, 'name');
78
-
79
- $scope.checksums = Checksum.checksums;
80
- $scope.downloadPolicies = DownloadPolicy.downloadPolicies;
81
- $scope.ostreeUpstreamSyncPolicies = OstreeUpstreamSyncPolicy.syncPolicies;
82
- $scope.ignorableYumContentUnits = YumContentUnits.units;
83
-
84
- $scope.$watch('repository.name', function () {
85
- if ($scope.repositoryForm && $scope.repositoryForm.name) {
86
- $scope.repositoryForm.name.$setValidity('server', true);
87
- FormUtils.labelize($scope.repository);
88
- }
89
- });
90
-
91
- $scope.handleFiles = function (element) {
92
- var reader = new FileReader();
93
- reader.addEventListener("loadend", function() {
94
- var data = reader.result;
95
- /* eslint-disable camelcase */
96
- $scope.repository.ansible_collection_requirements = data;
97
- $scope.$apply();
98
- });
99
- reader.readAsText(element.files[0]);
100
- };
101
-
102
- ContentCredential.queryUnpaged(function (contentCredentials) {
103
- $scope.contentCredentials = contentCredentials.results;
104
- });
105
-
106
- Architecture.queryUnpaged(function (architecture) {
107
- var results = architecture.results;
108
- var noarch = {
109
- id: 'noarch',
110
- name: translate('Default'),
111
- value: null
92
+ $scope.handleFiles = function (element) {
93
+ var reader = new FileReader();
94
+ reader.addEventListener("loadend", function() {
95
+ var data = reader.result;
96
+ /* eslint-disable camelcase */
97
+ $scope.repository.ansible_collection_requirements = data;
98
+ $scope.$apply();
99
+ });
100
+ reader.readAsText(element.files[0]);
112
101
  };
113
- results.map(function(i) {
114
- i.id = i.name;
102
+
103
+ ContentCredential.queryUnpaged(function (contentCredentials) {
104
+ $scope.contentCredentials = contentCredentials.results;
115
105
  });
116
- results.unshift(noarch);
117
- $scope.architecture = results;
118
- $scope.repository.arch = results[0].id;
119
- });
120
-
121
- $scope.save = function (repository) {
122
- if (repository.content_type === 'ostree') {
123
- repository.unprotected = false;
124
- }
125
- if (repository.content_type !== 'yum') {
126
- repository['download_policy'] = '';
127
- }
128
- if (repository.arch === 'Default') {
129
- repository.arch = null;
130
- }
131
- repository.$save(success, error);
132
- };
133
106
 
134
- $scope.repository['http_proxy_policy'] = HttpProxyPolicy.policies[0].label;
135
- $scope.policies = HttpProxyPolicy.policies;
136
- $scope.proxies = [];
107
+ Architecture.queryUnpaged(function (architecture) {
108
+ var results = architecture.results;
109
+ var noarch = {
110
+ id: 'noarch',
111
+ name: translate('No restriction'),
112
+ value: null
113
+ };
114
+ results.map(function(i) {
115
+ i.id = i.name;
116
+ });
117
+ results.unshift(noarch);
118
+ $scope.architecture = results;
119
+ $scope.repository.arch = results[0].id;
120
+ });
121
+
122
+ $scope.save = function (repository) {
123
+ if (repository.content_type === 'ostree') {
124
+ repository.unprotected = false;
125
+ }
126
+ if (repository.content_type === 'yum') {
127
+ repository.os_versions = $scope.osVersionsParam();
128
+ }
129
+ if (repository.content_type !== 'yum') {
130
+ repository['download_policy'] = '';
131
+ }
132
+ if (repository.arch === 'No restriction') {
133
+ repository.arch = null;
134
+ }
135
+ repository.$save(success, error);
136
+ };
137
+
138
+ $scope.repository['http_proxy_policy'] = HttpProxyPolicy.policies[0].label;
139
+ $scope.policies = HttpProxyPolicy.policies;
140
+ $scope.proxies = [];
137
141
 
138
- $scope.collectionURLPopover = $sce.trustAsHtml("You can sync collections utilizing just the url:<br/>" +
142
+ $scope.collectionURLPopover = $sce.trustAsHtml("You can sync collections utilizing just the url:<br/>" +
139
143
  "<b>1. For all collections in Ansible Galaxy:</b><br/>" +
140
144
  "https://galaxy.ansible.com/api/v2/collections <br/>" +
141
145
  "<b>2. For specific collection with URL filtering:</b><br/>" +
@@ -143,18 +147,26 @@ angular.module('Bastion.repositories').controller('NewRepositoryController',
143
147
  "<b>3. For specific collections with Requirements.yml:</b><br/>" +
144
148
  "Use base URL https://galaxy.ansible.com/ and specify requirements.yml below to specify collections");
145
149
 
146
- $scope.requirementPopover = $sce.trustAsHtml("To learn more about requirement.yml specification, visit <a href='https://docs.ansible.com/ansible/devel/dev_guide/collections_tech_preview.html#install-multiple-collections-with-a-requirements-file' target=\"_blank\">documentation </a>");
150
+ $scope.requirementPopover = $sce.trustAsHtml("To learn more about requirement.yml specification, visit <a href='https://docs.ansible.com/ansible/devel/dev_guide/collections_tech_preview.html#install-multiple-collections-with-a-requirements-file' target=\"_blank\">documentation </a>");
151
+
152
+ $scope.displayHttpProxyPolicyName = function (policy) {
153
+ return HttpProxyPolicy.displayHttpProxyPolicyName(policy);
154
+ };
155
+
156
+ $scope.displayHttpProxyName = function (proxyId) {
157
+ return HttpProxyPolicy.displayHttpProxyName($scope.proxies, proxyId);
158
+ };
159
+
160
+ HttpProxy.queryUnpaged(function (proxies) {
161
+ $scope.proxies = proxies.results;
162
+ });
147
163
 
148
- $scope.displayHttpProxyPolicyName = function (policy) {
149
- return HttpProxyPolicy.displayHttpProxyPolicyName(policy);
150
- };
164
+ $scope.osVersionsOptions = OSVersions.getOSVersionsOptions($scope.repository);
165
+ $scope.repository.os_versions = $scope.osVersionsOptions[0]; // ensure that No restriction is selected initially
151
166
 
152
- $scope.displayHttpProxyName = function (proxyId) {
153
- return HttpProxyPolicy.displayHttpProxyName($scope.proxies, proxyId);
154
- };
167
+ $scope.osVersionsParam = function () {
168
+ return OSVersions.osVersionsParam($scope.repository.os_versions);
169
+ };
155
170
 
156
- HttpProxy.queryUnpaged(function (proxies) {
157
- $scope.proxies = proxies.results;
158
- });
159
- }]
171
+ }]
160
172
  );
@@ -50,10 +50,22 @@
50
50
  ng-model="repository.arch"
51
51
  ng-options="arch.id as arch.name for arch in architecture">
52
52
  </select>
53
- <p class="help-block" translate>
54
- Choose <b>Default</b> to enable the repository for all architectures
55
- </p>
56
53
  </div>
54
+
55
+ <div
56
+ bst-form-group label="{{ 'Restrict to OS version' | translate }}"
57
+ ng-if="repository.content_type === 'yum'"
58
+ >
59
+ <select id="os_versions"
60
+ name="os_versions"
61
+ ng-model="repository.os_versions"
62
+ ng-options="tag as tag.name for tag in osVersionsOptions track by tag.id">
63
+ </select>
64
+ <p class="help-block" translate>
65
+ The repository will be enabled by default on content hosts with the selected OS version.
66
+ </p>
67
+ </div>
68
+
57
69
  </div>
58
70
  <div ng-show="repository.content_type !== undefined">
59
71
  <h4 translate> Sync Settings </h4>
@@ -0,0 +1,46 @@
1
+
2
+ /**
3
+ * @ngdoc service
4
+ * @name Bastion.products.details.repositories.service:OSVersions
5
+ *
6
+ * @description
7
+ * Helper functions for repo osVersions.
8
+ */
9
+
10
+ angular
11
+ .module('Bastion.repositories')
12
+ .service('OSVersions', function () {
13
+
14
+ this.getOSVersionsOptions = function () {
15
+ return [
16
+ { name: 'No restriction', id: '' },
17
+ { name: 'Red Hat Enterprise Linux 8 ', id: 'rhel-8' },
18
+ { name: 'Red Hat Enterprise Linux 7 ', id: 'rhel-7' },
19
+ { name: 'Red Hat Enterprise Linux 6 ', id: 'rhel-6' }
20
+ ];
21
+ };
22
+
23
+ // return an array of OS versions
24
+ this.osVersionsParam = function (osVersion) {
25
+ var param = osVersion;
26
+ if (osVersion && osVersion.hasOwnProperty('id')) {
27
+ param = osVersion.id;
28
+ }
29
+ // exclude null, undefined, and ''
30
+ return [param].filter(function (el) {
31
+ return el && el !== '';
32
+ });
33
+ };
34
+
35
+ // return the OS versions as comma-separated string
36
+ this.formatOSVersions = function (osVersionList) {
37
+ var individualVersions, versionStr;
38
+ individualVersions = this.osVersionsParam(osVersionList);
39
+ if (individualVersions) {
40
+ versionStr = individualVersions.join(",");
41
+ }
42
+ return versionStr;
43
+ };
44
+
45
+ }
46
+ );
@@ -11,7 +11,6 @@
11
11
  * current state of the application.
12
12
  */
13
13
  function RepositoryTypesService(repositoryTypes) {
14
-
15
14
  this.repositoryTypes = function () {
16
15
  return repositoryTypes;
17
16
  };
@@ -28,6 +27,14 @@
28
27
  });
29
28
  return angular.isDefined(found);
30
29
  };
30
+
31
+ this.pulp3Supported = function(desiredType) {
32
+ var found = _.find(repositoryTypes, function(type) {
33
+ return type.id === desiredType;
34
+ });
35
+
36
+ return found.pulp3_support;
37
+ };
31
38
  }
32
39
 
33
40
  angular
@@ -1,5 +1,5 @@
1
1
  <div id="content-access-mode-banner" bst-alert="info" ng-show="simpleContentAccessEnabled">
2
2
  <span translate>
3
- This organization has Simple Content Access enabled. Hosts can consume from all repositories in their Content View regardless of subscription status.
3
+ This organization has Simple Content Access enabled. Hosts are not required to have subscriptions attached to access repositories.
4
4
  </span>
5
5
  </div>
@@ -16,7 +16,7 @@
16
16
  <nav data-block="item-actions" bst-feature-flag="custom_products">
17
17
  <span select-action-dropdown>
18
18
  <ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu role="menu">
19
- <li role="menuitem" ng-hide="denied('sync_products')">
19
+ <li role="menuitem" ng-hide="denied('sync_sync_plans')">
20
20
  <a ng-click="runSyncPlan()">
21
21
  <span translate>Run Sync Plan</span>
22
22
  </a>
@@ -178,6 +178,7 @@ module Katello
178
178
  ::SmartProxiesController.include Katello::Concerns::SmartProxiesControllerExtensions
179
179
  ::Foreman::Plugin.fact_importer_registry.register(Katello::RhsmFactName::FACT_TYPE, Katello::RhsmFactImporter)
180
180
  ::FactParser.register_fact_parser(Katello::RhsmFactName::FACT_TYPE, Katello::RhsmFactParser)
181
+ ::RegistrationController.include Katello::Concerns::RegistrationControllerExtensions
181
182
 
182
183
  #Helper Extensions
183
184
  ::SmartProxiesController.class_eval do
@@ -216,6 +217,7 @@ module Katello
216
217
  ::Api::V2::HostsController.include Katello::Concerns::Api::V2::HostsControllerExtensions
217
218
  ::Api::V2::HostgroupsController.include Katello::Concerns::Api::V2::HostgroupsControllerExtensions
218
219
  ::Api::V2::SmartProxiesController.include Katello::Concerns::Api::V2::SmartProxiesControllerExtensions
220
+ ::Api::V2::RegistrationController.prepend Katello::Concerns::Api::V2::RegistrationControllerExtensions
219
221
 
220
222
  ::HostsController.class_eval do
221
223
  helper Katello::Concerns::HostsAndHostgroupsHelperExtensions
@@ -8,10 +8,10 @@ module Katello
8
8
  activation_keys_permissions
9
9
  capsule_content_permissions
10
10
  content_view_permissions
11
- gpg_key_permissions
12
11
  content_credential_permissions
13
12
  host_collections_permissions
14
13
  lifecycle_environment_permissions
14
+ organization_permissions
15
15
  product_permissions
16
16
  subscription_permissions
17
17
  sync_plan_permissions
@@ -25,7 +25,8 @@ module Katello
25
25
  'katello/api/v2/activation_keys' => [:index, :show, :available_host_collections, :available_releases,
26
26
  :product_content, :auto_complete_search]
27
27
  },
28
- :resource_type => 'Katello::ActivationKey'
28
+ :resource_type => 'Katello::ActivationKey',
29
+ :finder_scope => :readable
29
30
  @plugin.permission :create_activation_keys,
30
31
  {
31
32
  'katello/api/v2/activation_keys' => [:create, :copy]
@@ -37,12 +38,14 @@ module Katello
37
38
  :add_subscriptions, :remove_subscriptions,
38
39
  :add_host_collections, :remove_host_collections]
39
40
  },
40
- :resource_type => 'Katello::ActivationKey'
41
+ :resource_type => 'Katello::ActivationKey',
42
+ :finder_scope => :editable
41
43
  @plugin.permission :destroy_activation_keys,
42
44
  {
43
45
  'katello/api/v2/activation_keys' => [:destroy]
44
46
  },
45
- :resource_type => 'Katello::ActivationKey'
47
+ :resource_type => 'Katello::ActivationKey',
48
+ :finder_scope => :deletable
46
49
  end
47
50
 
48
51
  def capsule_content_permissions
@@ -72,7 +75,8 @@ module Katello
72
75
  'katello/api/v2/content_view_histories' => [:index, :auto_complete_search],
73
76
  'katello/api/v2/content_view_puppet_modules' => [:index, :show, :auto_complete_search],
74
77
  'katello/api/v2/content_view_repositories' => [:show_all],
75
- 'katello/api/v2/content_view_versions' => [:index, :show, :auto_complete_search, :export_histories],
78
+ 'katello/api/v2/content_view_versions' => [:index, :show, :auto_complete_search],
79
+ 'katello/api/v2/content_exports' => [:api_status],
76
80
  'katello/api/v2/content_view_components' => [:index, :show],
77
81
  'katello/api/v2/packages' => [:index],
78
82
  'katello/api/v2/package_groups' => [:index, :show, :auto_complete_search, :compare],
@@ -109,7 +113,8 @@ module Katello
109
113
  :view_compare_puppet_modules,
110
114
  :views]
111
115
  },
112
- :resource_type => 'Katello::ContentView'
116
+ :resource_type => 'Katello::ContentView',
117
+ :finder_scope => :readable
113
118
  @plugin.permission :create_content_views,
114
119
  {
115
120
  'katello/api/v2/content_views' => [:create, :copy]
@@ -124,76 +129,68 @@ module Katello
124
129
  'katello/api/v2/content_view_puppet_modules' => [:create, :update, :destroy],
125
130
  'katello/api/v2/content_view_components' => [:add_components, :remove_components, :update]
126
131
  },
127
- :resource_type => 'Katello::ContentView'
132
+ :resource_type => 'Katello::ContentView',
133
+ :finder_scope => :editable
128
134
  @plugin.permission :destroy_content_views,
129
135
  {
130
136
  'katello/api/v2/content_views' => [:destroy, :remove],
131
137
  'katello/api/v2/content_view_versions' => [:destroy]
132
138
  },
133
- :resource_type => 'Katello::ContentView'
139
+ :resource_type => 'Katello::ContentView',
140
+ :finder_scope => :deletable
134
141
  @plugin.permission :publish_content_views,
135
142
  {
136
143
  'katello/api/v2/content_views' => [:publish],
137
- 'katello/api/v2/content_view_versions' => [:incremental_update, :republish_repositories, :import]
144
+ 'katello/api/v2/content_view_versions' => [:incremental_update, :republish_repositories],
145
+ 'katello/api/v2/content_imports' => [:version]
138
146
  },
139
- :resource_type => 'Katello::ContentView'
147
+ :resource_type => 'Katello::ContentView',
148
+ :finder_scope => :publishable
140
149
  @plugin.permission :promote_or_remove_content_views,
141
150
  {
142
151
  'katello/api/v2/content_view_versions' => [:promote],
143
152
  'katello/api/v2/content_views' => [:remove_from_environment, :remove, :republish_repositories]
144
153
  },
145
- :resource_type => 'Katello::ContentView'
154
+ :resource_type => 'Katello::ContentView',
155
+ :finder_scope => :promotable_or_removable
146
156
  @plugin.permission :export_content_views,
147
157
  {
148
- 'katello/api/v2/content_view_versions' => [:export]
149
- },
150
- :resource_type => 'Katello::ContentView'
151
- end
152
-
153
- def gpg_key_permissions
154
- @plugin.permission :view_gpg_keys,
155
- {
156
- 'katello/api/v2/gpg_keys' => [:index, :show, :content, :auto_complete_search]
158
+ 'katello/api/v2/content_view_versions' => [:export],
159
+ 'katello/api/v2/content_exports' => [:version, :index, :api_status],
160
+ 'katello/api/v2/content_export_incrementals' => [:version]
157
161
  },
158
- :resource_type => 'Katello::GpgKey'
159
- @plugin.permission :create_gpg_keys,
160
- {
161
- 'katello/api/v2/gpg_keys' => [:create]
162
- },
163
- :resource_type => 'Katello::GpgKey'
164
- @plugin.permission :edit_gpg_keys,
165
- {
166
- 'katello/api/v2/gpg_keys' => [:update, :set_content]
167
- },
168
- :resource_type => 'Katello::GpgKey'
169
- @plugin.permission :destroy_gpg_keys,
170
- {
171
- 'katello/api/v2/gpg_keys' => [:destroy]
172
- },
173
- :resource_type => 'Katello::GpgKey'
162
+ :resource_type => 'Katello::ContentView',
163
+ :finder_scope => :exportable
174
164
  end
175
165
 
176
166
  def content_credential_permissions
177
167
  @plugin.permission :view_content_credentials,
178
168
  {
179
- 'katello/api/v2/content_credentials' => [:index, :show, :content, :auto_complete_search]
169
+ 'katello/api/v2/content_credentials' => [:index, :show, :content, :auto_complete_search],
170
+ 'katello/api/v2/gpg_keys' => [:index, :show, :content, :auto_complete_search]
180
171
  },
181
- :resource_type => 'Katello::GpgKey'
172
+ :resource_type => 'Katello::GpgKey',
173
+ :finder_scope => :readable
182
174
  @plugin.permission :create_content_credentials,
183
175
  {
184
- 'katello/api/v2/content_credentials' => [:create]
176
+ 'katello/api/v2/content_credentials' => [:create],
177
+ 'katello/api/v2/gpg_keys' => [:create]
185
178
  },
186
179
  :resource_type => 'Katello::GpgKey'
187
180
  @plugin.permission :edit_content_credentials,
188
181
  {
189
- 'katello/api/v2/content_credentials' => [:update, :set_content]
182
+ 'katello/api/v2/content_credentials' => [:update, :set_content],
183
+ 'katello/api/v2/gpg_keys' => [:update, :set_content]
190
184
  },
191
- :resource_type => 'Katello::GpgKey'
185
+ :resource_type => 'Katello::GpgKey',
186
+ :finder_scope => :editable
192
187
  @plugin.permission :destroy_content_credentials,
193
188
  {
194
- 'katello/api/v2/content_credentials' => [:destroy]
189
+ 'katello/api/v2/content_credentials' => [:destroy],
190
+ 'katello/api/v2/gpg_keys' => [:destroy]
195
191
  },
196
- :resource_type => 'Katello::GpgKey'
192
+ :resource_type => 'Katello::GpgKey',
193
+ :finder_scope => :deletable
197
194
  end
198
195
 
199
196
  def host_collections_permissions
@@ -201,22 +198,26 @@ module Katello
201
198
  {
202
199
  'katello/api/v2/host_collections' => [:index, :show, :auto_complete_search]
203
200
  },
204
- :resource_type => 'Katello::HostCollection'
201
+ :resource_type => 'Katello::HostCollection',
202
+ :finder_scope => :readable
205
203
  @plugin.permission :create_host_collections,
206
204
  {
207
205
  'katello/api/v2/host_collections' => [:create, :copy]
208
206
  },
209
- :resource_type => 'Katello::HostCollection'
207
+ :resource_type => 'Katello::HostCollection',
208
+ :finder_scope => :creatable
210
209
  @plugin.permission :edit_host_collections,
211
210
  {
212
211
  'katello/api/v2/host_collections' => [:update, :add_hosts, :remove_hosts]
213
212
  },
214
- :resource_type => 'Katello::HostCollection'
213
+ :resource_type => 'Katello::HostCollection',
214
+ :finder_scope => :editable
215
215
  @plugin.permission :destroy_host_collections,
216
216
  {
217
217
  'katello/api/v2/host_collections' => [:destroy]
218
218
  },
219
- :resource_type => 'Katello::HostCollection'
219
+ :resource_type => 'Katello::HostCollection',
220
+ :finder_scope => :deletable
220
221
  end
221
222
 
222
223
  def lifecycle_environment_permissions
@@ -225,26 +226,30 @@ module Katello
225
226
  'katello/api/v2/environments' => [:index, :show, :paths, :repositories, :auto_complete_search],
226
227
  'katello/api/rhsm/candlepin_proxies' => [:rhsm_index]
227
228
  },
228
- :resource_type => 'Katello::KTEnvironment'
229
+ :resource_type => 'Katello::KTEnvironment',
230
+ :finder_scope => :readable
229
231
  @plugin.permission :create_lifecycle_environments,
230
232
  {
231
233
  'katello/api/v2/environments' => [:create]
232
234
  },
233
- :resource_type => 'Katello::KTEnvironment'
235
+ :resource_type => 'Katello::KTEnvironment',
236
+ :finder_scope => :creatable
234
237
  @plugin.permission :edit_lifecycle_environments,
235
238
  {
236
239
  'katello/api/v2/environments' => [:update]
237
240
  },
238
- :resource_type => 'Katello::KTEnvironment'
241
+ :resource_type => 'Katello::KTEnvironment',
242
+ :finder_scope => :editable
239
243
  @plugin.permission :destroy_lifecycle_environments,
240
244
  {
241
245
  'katello/api/v2/environments' => [:destroy]
242
246
  },
243
- :resource_type => 'Katello::KTEnvironment'
244
-
247
+ :resource_type => 'Katello::KTEnvironment',
248
+ :finder_scope => :deletable
245
249
  @plugin.permission :promote_or_remove_content_views_to_environments,
246
250
  {},
247
- :resource_type => 'Katello::KTEnvironment'
251
+ :resource_type => 'Katello::KTEnvironment',
252
+ :finder_scope => :promotable
248
253
  end
249
254
 
250
255
  def product_permissions # rubocop:disable Metrics/MethodLength
@@ -292,7 +297,8 @@ module Katello
292
297
  :repo_puppet_modules,
293
298
  :repo_compare_errata,
294
299
  :repo_compare_packages,
295
- :repo_compare_puppet_modules]
300
+ :repo_compare_puppet_modules],
301
+ 'katello/api/v2/repository_sets' => [:index, :show, :available_repositories, :auto_complete_search]
296
302
  },
297
303
  :resource_type => 'Katello::Product',
298
304
  :finder_scope => :readable
@@ -301,14 +307,16 @@ module Katello
301
307
  'katello/api/v2/products' => [:create],
302
308
  'katello/api/v2/package_groups' => [:create]
303
309
  },
304
- :resource_type => 'Katello::Product'
310
+ :resource_type => 'Katello::Product',
311
+ :finder_scope => :editable
305
312
  @plugin.permission :edit_products,
306
313
  {
307
314
  'katello/api/v2/products' => [:update],
308
315
  'katello/api/v2/repositories' => [:create, :update, :remove_content, :import_uploads, :upload_content, :republish, :verify_checksum],
309
316
  'katello/api/v2/products_bulk_actions' => [:update_sync_plans, :update_http_proxy, :verify_checksum_products],
310
317
  'katello/api/v2/content_uploads' => [:create, :update, :destroy],
311
- 'katello/api/v2/organizations' => [:repo_discover, :cancel_repo_discover]
318
+ 'katello/api/v2/organizations' => [:repo_discover, :cancel_repo_discover],
319
+ 'katello/api/v2/repository_sets' => [:enable, :disable]
312
320
  },
313
321
  :resource_type => 'Katello::Product',
314
322
  :finder_scope => :editable
@@ -329,7 +337,6 @@ module Katello
329
337
  'katello/api/v2/products_bulk_actions' => [:sync_products],
330
338
  'katello/api/v2/repositories_bulk_actions' => [:sync_repositories],
331
339
  'katello/api/v2/sync' => [:index],
332
- 'katello/api/v2/sync_plans' => [:sync],
333
340
  'katello/sync_management' => [:index, :sync_status, :product_status, :sync, :destroy]
334
341
  },
335
342
  :resource_type => 'Katello::Product',
@@ -342,11 +349,10 @@ module Katello
342
349
  :finder_scope => :exportable
343
350
  end
344
351
 
345
- def subscription_permissions # rubocop:disable Metrics/MethodLength
352
+ def subscription_permissions
346
353
  @plugin.permission :view_subscriptions,
347
354
  {
348
- 'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search],
349
- 'katello/api/v2/repository_sets' => [:index, :show, :available_repositories, :auto_complete_search]
355
+ 'katello/api/v2/subscriptions' => [:index, :show, :available, :manifest_history, :auto_complete_search]
350
356
  },
351
357
  :resource_type => 'Katello::Subscription'
352
358
  @plugin.permission :attach_subscriptions,
@@ -361,8 +367,7 @@ module Katello
361
367
  :resource_type => 'Katello::Subscription'
362
368
  @plugin.permission :import_manifest,
363
369
  {
364
- 'katello/api/v2/subscriptions' => [:upload, :refresh_manifest],
365
- 'katello/api/v2/repository_sets' => [:enable, :disable]
370
+ 'katello/api/v2/subscriptions' => [:upload, :refresh_manifest]
366
371
  },
367
372
  :resource_type => 'Katello::Subscription'
368
373
  @plugin.permission :delete_manifest,
@@ -372,7 +377,7 @@ module Katello
372
377
  :resource_type => 'Katello::Subscription'
373
378
  @plugin.permission :manage_subscription_allocations,
374
379
  {
375
- 'katello/api/v2/upstream_subscriptions' => [:index, :create, :destroy, :update, :ping, :enable_simple_content_access, :disable_simple_content_access]
380
+ 'katello/api/v2/upstream_subscriptions' => [:index, :create, :destroy, :update, :ping, :enable_simple_content_access, :disable_simple_content_access, :simple_content_access_eligible]
376
381
  },
377
382
  :resource_type => 'Katello::Subscription'
378
383
  end
@@ -380,25 +385,34 @@ module Katello
380
385
  def sync_plan_permissions
381
386
  @plugin.permission :view_sync_plans,
382
387
  {
383
- 'katello/api/v2/sync_plans' => [:index, :show, :add_products, :remove_products, :available_products, :auto_complete_search],
384
- 'katello/api/v2/products' => [:index]
388
+ 'katello/api/v2/sync_plans' => [:index, :show, :add_products, :remove_products, :available_products, :auto_complete_search]
385
389
  },
386
- :resource_type => 'Katello::SyncPlan'
390
+ :resource_type => 'Katello::SyncPlan',
391
+ :finder_scope => :readable
387
392
  @plugin.permission :create_sync_plans,
388
393
  {
389
394
  'katello/api/v2/sync_plans' => [:create]
390
395
  },
391
- :resource_type => 'Katello::SyncPlan'
396
+ :resource_type => 'Katello::SyncPlan',
397
+ :finder_scope => :editable
392
398
  @plugin.permission :edit_sync_plans,
393
399
  {
394
400
  'katello/api/v2/sync_plans' => [:update]
395
401
  },
396
- :resource_type => 'Katello::SyncPlan'
402
+ :resource_type => 'Katello::SyncPlan',
403
+ :finder_scope => :editable
397
404
  @plugin.permission :destroy_sync_plans,
398
405
  {
399
406
  'katello/api/v2/sync_plans' => [:destroy]
400
407
  },
401
- :resource_type => 'Katello::SyncPlan'
408
+ :resource_type => 'Katello::SyncPlan',
409
+ :finder_scope => :deletable
410
+ @plugin.permission :sync_sync_plans,
411
+ {
412
+ 'katello/api/v2/sync_plans' => [:sync]
413
+ },
414
+ :resource_type => 'Katello::SyncPlan',
415
+ :finder_scope => :syncable
402
416
  end
403
417
 
404
418
  def user_permissions
@@ -408,5 +422,20 @@ module Katello
408
422
  },
409
423
  :public => true
410
424
  end
425
+
426
+ def organization_permissions
427
+ @plugin.permission :import_library_content,
428
+ {
429
+ 'katello/api/v2/content_imports' => [:library]
430
+ },
431
+ :resource_type => 'Organization'
432
+
433
+ @plugin.permission :export_library_content,
434
+ {
435
+ 'katello/api/v2/content_exports' => [:library],
436
+ 'katello/api/v2/content_export_incrementals' => [:library]
437
+ },
438
+ :resource_type => 'Organization'
439
+ end
411
440
  end
412
441
  end