Class: Api::V2::UsergroupsController

Inherits:
BaseController show all
Includes:
Foreman::Controller::Parameters::Usergroup
Defined in:
app/controllers/api/v2/usergroups_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#append_array_of_ids, #check_media_type, #metadata_by, #metadata_order, #metadata_page, #metadata_per_page, #metadata_search, #metadata_subtotal, #metadata_total, #render_error, #root_node_name, #setup_has_many_params

Methods included from Api::Version2

#api_version

Methods inherited from BaseController

#api_request?, #controller_permission, #get_resource, parameter_filter_context, #parent_scope, #resource_class_join, #resource_scope, #resource_scope_for_index

Methods included from Foreman::Controller::BruteforceProtection

#bruteforce_attempt?

Methods included from ApplicationShared

#current_permission, #find_default_taxonomy, #find_session_taxonomy, #scope_by_resource_id, #set_current_taxonomy, #set_current_user, #set_taxonomy, #store_default_taxonomy, #store_taxonomy

Methods included from FindCommon

#controller_permission, #find_resource, #resource_class, #resource_class_for, #resource_finder, #resource_name, #resource_scope, #scope_for

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread

Methods included from Foreman::Controller::Timezone

#set_timezone

Methods included from Foreman::Controller::TopbarSweeper

#set_topbar_sweeper_controller

Methods included from Foreman::Controller::Session

#backup_session_content, #expire_session, #ignore_api_request?, #session_expiry, #set_activity_time, #update_activity_time

Methods included from Foreman::Controller::Authentication

#authenticate, #authorized, #available_sso, #check_user_enabled, #is_admin?, #path_to_authenticate, #require_login

Methods included from Foreman::Controller::MigrationChecker

needs_migration?

Instance Method Details

#createObject


36
37
38
39
# File 'app/controllers/api/v2/usergroups_controller.rb', line 36

def create
  @usergroup = Usergroup.new(usergroup_params)
  process_response @usergroup.save
end

#destroyObject


59
60
61
# File 'app/controllers/api/v2/usergroups_controller.rb', line 59

def destroy
  process_response @usergroup.destroy
end

#indexObject


13
14
15
# File 'app/controllers/api/v2/usergroups_controller.rb', line 13

def index
  @usergroups = resource_scope_for_index
end

#showObject


20
21
# File 'app/controllers/api/v2/usergroups_controller.rb', line 20

def show
end

#updateObject


52
53
54
# File 'app/controllers/api/v2/usergroups_controller.rb', line 52

def update
  process_response @usergroup.update(usergroup_params)
end