diff --git a/app/controllers/api/v2/architectures_controller.rb b/app/controllers/api/v2/architectures_controller.rb index cc1fa4c57cd..12cf49f1d2b 100644 --- a/app/controllers/api/v2/architectures_controller.rb +++ b/app/controllers/api/v2/architectures_controller.rb @@ -3,6 +3,8 @@ module V2 class ArchitecturesController < V2::BaseController include Foreman::Controller::Parameters::Architecture + hide_taxonomy_options + before_action :find_optional_nested_object before_action :find_resource, :only => %w{show update destroy} diff --git a/app/controllers/api/v2/base_controller.rb b/app/controllers/api/v2/base_controller.rb index 4f62ebff798..450828b2600 100644 --- a/app/controllers/api/v2/base_controller.rb +++ b/app/controllers/api/v2/base_controller.rb @@ -168,6 +168,13 @@ def render_error(error, options = { }) render options.merge(:template => "api/v2/errors/#{error}", :layout => 'api/v2/layouts/error_layout') end + + def self.hide_taxonomy_options + resource_description do + param :location_id, Integer, :show => false + param :organization_id, Integer, :show => false + end + end end end end diff --git a/app/controllers/api/v2/external_usergroups_controller.rb b/app/controllers/api/v2/external_usergroups_controller.rb index 71102c37562..d18668da4b9 100644 --- a/app/controllers/api/v2/external_usergroups_controller.rb +++ b/app/controllers/api/v2/external_usergroups_controller.rb @@ -4,6 +4,8 @@ class ExternalUsergroupsController < V2::BaseController include Api::Version2 include Foreman::Controller::Parameters::ExternalUsergroup + hide_taxonomy_options + before_action :find_resource, :only => [:show, :update, :destroy, :refresh] before_action :find_required_nested_object, :only => [:index, :show, :create] after_action :refresh_external_usergroup, :only => [:create, :update, :destroy] diff --git a/app/controllers/api/v2/settings_controller.rb b/app/controllers/api/v2/settings_controller.rb index f1ce5fd22b7..696f9de248d 100644 --- a/app/controllers/api/v2/settings_controller.rb +++ b/app/controllers/api/v2/settings_controller.rb @@ -1,6 +1,8 @@ module Api module V2 class SettingsController < V2::BaseController + hide_taxonomy_options + before_action :find_resource, :only => %w{show update} def_param_group :setting_params do diff --git a/app/controllers/api/v2/usergroups_controller.rb b/app/controllers/api/v2/usergroups_controller.rb index 0aab34c3755..f8f69ab8e10 100644 --- a/app/controllers/api/v2/usergroups_controller.rb +++ b/app/controllers/api/v2/usergroups_controller.rb @@ -3,6 +3,8 @@ module V2 class UsergroupsController < V2::BaseController include Foreman::Controller::Parameters::Usergroup + hide_taxonomy_options + before_action :find_optional_nested_object before_action :find_resource, :only => %w{show update destroy}