diff --git a/app/controllers/katello/api/v2/capsules_controller.rb b/app/controllers/katello/api/v2/capsules_controller.rb index 2f3d520fc04..43e2a3bf917 100644 --- a/app/controllers/katello/api/v2/capsules_controller.rb +++ b/app/controllers/katello/api/v2/capsules_controller.rb @@ -29,16 +29,16 @@ def show super end + def resource_name + :smart_proxy + end + protected def resource_class SmartProxy end - def resource_name - :smart_proxy - end - def authorized User.current.allowed_to?(params.slice(:action, :id).merge(controller: 'api/v2/smart_proxies')) end diff --git a/app/controllers/katello/api/v2/products_controller.rb b/app/controllers/katello/api/v2/products_controller.rb index 939224996e9..912fc8e3572 100644 --- a/app/controllers/katello/api/v2/products_controller.rb +++ b/app/controllers/katello/api/v2/products_controller.rb @@ -109,7 +109,8 @@ def sync protected def find_product - @product = Product.find_by_id(params[:id]) if params[:id] + @product = Product.find_by_id(params[:id]) + fail HttpErrors::NotFound, _("Couldn't find product '%s'") % params[:id] unless @product end def find_activation_key