Project

General

Profile

Actions

Bug #11768

closed

Switching organization or location fails with mass assignment security error

Added by Tomáš Strachota about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Organizations and Locations
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Switching organization or location in the host form has no effect. The call fails with:

 | ActiveModel::MassAssignmentSecurity::Error (Can't mass-assign protected attributes: 0, new_interfaces):
 |   app/models/concerns/foreman/sti.rb:22:in `new'
 |   app/models/concerns/foreman/sti.rb:22:in `new_with_cast'
 |   app/models/host/base.rb:75:in `initialize'
 |   app/models/host/managed.rb:49:in `initialize'
 |   app/models/concerns/foreman/sti.rb:22:in `new'
 |   app/models/concerns/foreman/sti.rb:22:in `new_with_cast'
 |   app/models/host.rb:15:in `method_missing'
 |   app/controllers/hosts_controller.rb:538:in `process_taxonomy'
 |   app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 |   app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 |   lib/middleware/catch_json_parse_errors.rb:9:in `call'

Users probably won't notice anything as the page is not refreshed and the error remains hidden.

This is related to fix for http://projects.theforeman.org/issues/9058 which was supposed to prevent host interfaces from being reset on the taxonomy change. Unfortunately it was fixed only by mistake, because the exception occurs before the code that used to clear the interfaces.
It needs to be fixed too.


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #11767: Templates are not being resolved in the host formClosedMarek Hulán09/10/2015Actions
Related to Foreman - Bug #9058: Changing organization/location when creating new host resets interfaces setupClosedTom Caspy01/21/2015Actions
Actions #1

Updated by Tomáš Strachota about 9 years ago

  • Related to Bug #11767: Templates are not being resolved in the host form added
Actions #2

Updated by Tomáš Strachota about 9 years ago

  • Related to Bug #9058: Changing organization/location when creating new host resets interfaces setup added
Actions #3

Updated by Dominic Cleal about 9 years ago

  • Category changed from Web Interface to Organizations and Locations
  • Translation missing: en.field_release set to 63
Actions #4

Updated by Dominic Cleal about 9 years ago

  • Status changed from New to Resolved
  • Translation missing: en.field_release deleted (63)

Appears to have been resolved by #11767.

Actions

Also available in: Atom PDF