Class: HammerCLIForeman::User::UpdateCommand

Inherits:
HammerCLIForeman::UpdateCommand show all
Includes:
CommonUpdateOptions
Defined in:
lib/hammer_cli_foreman/user.rb

Instance Method Summary collapse

Methods included from CommonUpdateOptions

ask_password, #current_logged_user, included, #location_id, #organization_id

Methods inherited from HammerCLIForeman::UpdateCommand

command_name, create_option_builder, #method_options_for_params

Methods inherited from Command

build_options, connection_name, create_option_builder, #customized_options, #dependency_resolver, dependency_resolver, #exception_handler_class, #get_identifier, #get_resource_id, #get_resource_ids, #resolver, resolver, resource_config, resource_name_mapping, #searchables, searchables, #send_request, #transform_format

Instance Method Details

#request_paramsObject



113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/hammer_cli_foreman/user.rb', line 113

def request_params
  params = super

  if (option_password || option_ask_password)
    if current_logged_user["id"].to_s == params["id"].to_s
      if (!option_current_password && (option_password || option_ask_password))
        params['user']['current_password'] = HammerCLIForeman::User::CommonUpdateOptions::ask_password(:current)
      end
    end
  end
  params
end