Bug #21465

Setting owner does not work under non-admin user in some taxonomy

Added by Marek Hulán 7 months ago. Updated 4 months ago.

Status:Closed
Priority:Normal
Assigned To:Marek Hulán
Category:Organizations and Locations
Target version:Team Marek Iteration 25
Difficulty: Bugzilla link:1533044
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4954
Story points-
Velocity based estimate-
Release1.18.0Release relationshipAuto

Description

The host owner association is polymorphic belongs_to and in case we're in specific Organization, it applies default scope from Taxonomix, therefore it can't find owner by just calling self.owner. This causes problems in Katello when register content host in a specific org.

The issue can be probably reproduced also in core, make sure a host is owner by e.g. admin who's not in any organization, then under user in specific org/loc try to edit it. The before_validation fitler that sets the owner will fail to find self.owner even though self.owner_id is 3 and self.owner_type is admin.

The similar fix like for #16363 should help


Related issues

Related to Foreman - Bug #16363: "Unknown member type" error when deleting or editing user... Closed 08/29/2016

Associated revisions

Revision 1fa10070
Added by Marek Hulán 4 months ago

Fixes #21465 - load owners from any context

History

#1 Updated by Marek Hulán 7 months ago

  • Description updated (diff)

#2 Updated by Marek Hulán 7 months ago

  • Related to Bug #16363: "Unknown member type" error when deleting or editing usergroups with users from different locations added

#3 Updated by The Foreman Bot 7 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4954 added

#4 Updated by Marek Hulán 7 months ago

  • Target version set to Foreman - Team Marek Iteration 22

#5 Updated by Marek Hulán 7 months ago

  • Target version changed from Foreman - Team Marek Iteration 22 to Foreman - Team Marek Iteration 23

#6 Updated by Marek Hulán 6 months ago

  • Target version changed from Foreman - Team Marek Iteration 23 to Foreman - Team Marek Iteration 24

#7 Updated by Marek Hulán 5 months ago

  • Target version changed from Foreman - Team Marek Iteration 24 to Team Marek Iteration 25

#8 Updated by Marek Hulán 4 months ago

  • Bugzilla link set to 1533044

#9 Updated by Marek Hulán 4 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#10 Updated by Daniel Lobato Garcia 4 months ago

  • Release set to 1.17.0

#11 Updated by Marek Hulán 4 months ago

  • Release changed from 1.17.0 to 1.18.0

Also available in: Atom PDF