Project

General

Profile

« Previous | Next » 

Revision c69ab151

Added by Tomer Brisker about 5 years ago

Fixes #26648 - Remove taxonomy setting checks from routes

View differences:

config/routes.rb
resources :tasks, :only => [:show]
if SETTINGS[:locations_enabled]
resources :locations, :except => [:show] do
resources :hosts, :only => :index
member do
get 'select'
get "clone" => 'locations#clone_taxonomy'
get 'nest'
post 'import_mismatches'
get 'step2'
get 'assign_hosts'
post 'assign_all_hosts'
put 'assign_selected_hosts'
post 'parent_taxonomy_selected'
end
collection do
get 'auto_complete_search'
get 'clear'
get 'mismatches'
post 'import_mismatches'
end
resources :locations, :except => [:show] do
resources :hosts, :only => :index
member do
get 'select'
get "clone" => 'locations#clone_taxonomy'
get 'nest'
post 'import_mismatches'
get 'step2'
get 'assign_hosts'
post 'assign_all_hosts'
put 'assign_selected_hosts'
post 'parent_taxonomy_selected'
end
collection do
get 'auto_complete_search'
get 'clear'
get 'mismatches'
post 'import_mismatches'
end
end
if SETTINGS[:organizations_enabled]
resources :organizations, :except => [:show] do
member do
get 'select'
get "clone" => 'organizations#clone_taxonomy'
get 'nest'
post 'import_mismatches'
get 'step2'
get 'assign_hosts'
post 'assign_all_hosts'
put 'assign_selected_hosts'
post 'parent_taxonomy_selected'
end
collection do
get 'auto_complete_search'
get 'clear'
get 'mismatches'
post 'import_mismatches'
end
resources :organizations, :except => [:show] do
member do
get 'select'
get "clone" => 'organizations#clone_taxonomy'
get 'nest'
post 'import_mismatches'
get 'step2'
get 'assign_hosts'
post 'assign_all_hosts'
put 'assign_selected_hosts'
post 'parent_taxonomy_selected'
end
collection do
get 'auto_complete_search'
get 'clear'
get 'mismatches'
post 'import_mismatches'
end
end
config/routes/api/v2.rb
resources :audits, :only => [:index, :show]
resources :auth_sources, :only => [:index, :show] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
end
resources :auth_source_externals, :only => [:index, :show, :update] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :external_usergroups, :except => [:new, :edit, :destroy]
resources :users, :except => [:new, :edit, :destroy]
end
......
resources :auth_source_internals, :only => [:index, :show]
resources :auth_source_ldaps, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :users, :except => [:new, :edit]
resources :external_usergroups, :except => [:new, :edit]
end
......
resources :common_parameters, :except => [:new, :edit]
resources :config_templates, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
post :clone, :on => :member
collection do
post 'build_pxe_default'
......
resources :os_default_templates, :except => [:new, :edit]
end
resources :provisioning_templates, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
member do
post :clone
get :export
......
resources :dashboard, :only => [:index]
resources :environments, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :smart_proxies, :only => [] do
post :import_puppetclasses, :on => :member
end
......
resources :fact_values, :only => [:index]
resources :hostgroups, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
post :clone, :on => :member
put :rebuild_config, :on => :member
resources :parameters, :except => [:new, :edit] do
......
end
resources :media, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :operatingsystems, :except => [:new, :edit]
end
......
end
resources :ptables, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
member do
post :clone
get :export
......
end
resources :report_templates, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
member do
post :clone, :generate, :schedule_report
get :export
......
resources :roles, :except => [:new, :edit] do
resources :filters, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
end
resources :users, :except => [:new, :edit]
member do
......
end
resources :filters, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
end
resources :settings, :only => [:index, :show, :update]
......
resources :trends, :only => [:create, :index, :show, :destroy]
resources :subnets, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :domains, :except => [:new, :edit]
resources :interfaces, :except => [:new, :edit]
resources :parameters, :except => [:new, :edit] do
......
# add "constraint" that unconstrained and allows :id to have dot notation ex. first.lastname
constraints(:id => /[^\/]+/) do
resources :users, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :roles, :except => [:new, :edit]
resources :usergroups, :except => [:new, :edit]
resources :ssh_keys, :only => [:index, :show, :create, :destroy]
......
get :available_zones, :on => :member
put :associate, :on => :member
put :refresh_cache, :on => :member
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :compute_attributes, :only => [:index, :show, :create, :update]
resources :compute_profiles, :except => [:new, :edit] do
resources :compute_attributes, :only => [:index, :show, :create, :update]
......
resources :mail_notifications, :only => [:index, :show]
resources :realms, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
resources :users, :except => [:new, :edit]
end
resources :domains, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
resources :parameters, :except => [:new, :edit] do
collection do
delete '/', :action => :reset
......
resources :interfaces, :except => [:new, :edit]
end
resources :smart_proxies, :except => [:new, :edit] do
(resources :locations, :only => [:index, :show]) if SETTINGS[:locations_enabled]
(resources :organizations, :only => [:index, :show]) if SETTINGS[:organizations_enabled]
resources :locations, :only => [:index, :show]
resources :organizations, :only => [:index, :show]
put :refresh, :on => :member
get :version, :on => :member
get :logs, :on => :member
......
resources :override_values, :only => [:update, :destroy]
end
if SETTINGS[:locations_enabled]
resources :locations, :except => [:new, :edit] do
# scoped by location
resources :locations, :except => [:new, :edit] do
# scoped by location
resources :auth_sources, :only => [:index, :show]
resources :auth_source_ldaps, :only => [:index, :show]
resources :auth_source_externals, :only => [:index, :show]
resources :domains, :only => [:index, :show]
resources :realms, :only => [:index, :show]
resources :subnets, :only => [:index, :show]
resources :hostgroups, :only => [:index, :show]
resources :environments, :only => [:index, :show]
resources :users, :only => [:index, :show]
resources :config_templates, :only => [:index, :show]
resources :provisioning_templates, :only => [:index, :show]
resources :ptables, :only => [:index, :show]
resources :compute_resources, :only => [:index, :show]
resources :media, :only => [:index, :show]
resources :smart_proxies, :only => [:index, :show]
resources :filters, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
resources :parameters, :except => [:new, :edit] do
collection do
delete '/', :action => :reset
end
end
# scoped by location AND organization
resources :organizations, :except => [:new, :edit] do
resources :auth_sources, :only => [:index, :show]
resources :auth_source_ldaps, :only => [:index, :show]
resources :auth_source_externals, :only => [:index, :show]
......
resources :smart_proxies, :only => [:index, :show]
resources :filters, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
resources :parameters, :except => [:new, :edit] do
collection do
delete '/', :action => :reset
end
end
end
end
# scoped by location AND organization
resources :organizations, :except => [:new, :edit] do
resources :auth_sources, :only => [:index, :show]
resources :auth_source_ldaps, :only => [:index, :show]
resources :auth_source_externals, :only => [:index, :show]
resources :domains, :only => [:index, :show]
resources :realms, :only => [:index, :show]
resources :subnets, :only => [:index, :show]
resources :hostgroups, :only => [:index, :show]
resources :environments, :only => [:index, :show]
resources :users, :only => [:index, :show]
resources :config_templates, :only => [:index, :show]
resources :provisioning_templates, :only => [:index, :show]
resources :ptables, :only => [:index, :show]
resources :compute_resources, :only => [:index, :show]
resources :media, :only => [:index, :show]
resources :smart_proxies, :only => [:index, :show]
resources :filters, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
resources :organizations, :except => [:new, :edit] do
# scoped by organization
resources :auth_sources, :only => [:index, :show]
resources :auth_source_ldaps, :only => [:index, :show]
resources :auth_source_externals, :only => [:index, :show]
resources :domains, :only => [:index, :show]
resources :realms, :only => [:index, :show]
resources :subnets, :only => [:index, :show]
resources :hostgroups, :only => [:index, :show]
resources :environments, :only => [:index, :show]
resources :users, :only => [:index, :show]
resources :config_templates, :only => [:index, :show]
resources :provisioning_templates, :only => [:index, :show]
resources :ptables, :only => [:index, :show]
resources :compute_resources, :only => [:index, :show]
resources :media, :only => [:index, :show]
resources :smart_proxies, :only => [:index, :show]
resources :filters, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
resources :parameters, :except => [:new, :edit] do
collection do
delete '/', :action => :reset
end
end
end
if SETTINGS[:organizations_enabled]
resources :organizations, :except => [:new, :edit] do
# scoped by organization
# scoped by location AND organization
resources :locations, :except => [:new, :edit] do
resources :auth_sources, :only => [:index, :show]
resources :auth_source_ldaps, :only => [:index, :show]
resources :auth_source_externals, :only => [:index, :show]
......
resources :smart_proxies, :only => [:index, :show]
resources :filters, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
resources :parameters, :except => [:new, :edit] do
collection do
delete '/', :action => :reset
end
end
# scoped by location AND organization
resources :locations, :except => [:new, :edit] do
resources :auth_sources, :only => [:index, :show]
resources :auth_source_ldaps, :only => [:index, :show]
resources :auth_source_externals, :only => [:index, :show]
resources :domains, :only => [:index, :show]
resources :realms, :only => [:index, :show]
resources :subnets, :only => [:index, :show]
resources :hostgroups, :only => [:index, :show]
resources :environments, :only => [:index, :show]
resources :users, :only => [:index, :show]
resources :config_templates, :only => [:index, :show]
resources :provisioning_templates, :only => [:index, :show]
resources :ptables, :only => [:index, :show]
resources :compute_resources, :only => [:index, :show]
resources :media, :only => [:index, :show]
resources :smart_proxies, :only => [:index, :show]
resources :filters, :only => [:index, :show]
resources :hosts, :except => [:new, :edit]
end
end
end
get 'orchestration/(:id)/tasks', :to => 'tasks#index'
resources :plugins, :only => [:index]
put 'auth_source_ldaps/(:id)/test', :to => 'auth_source_ldaps#test'

Also available in: Unified diff