Bug #12864

Changing role of user the ownership of its hosts gets removed & unable to edit users organization & location

Added by Brad Buckingham over 1 year ago. Updated 6 months ago.

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

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1238714
Description of problem:
Changing the role of user results in removal of its ownership from the hosts.
Also not able to edit the organization and location of that user.

Version-Release number of selected component (if applicable):
6.0.8

How reproducible:
Always

Steps to Reproduce:
1. The host profile which was owned by the user.
i.e after changing the role of user (in this case site-manager) the additional information tab of host profile reset the 'owned by' field to 'select an owner' but properties page shows the owner as same user.

2. The default assigned organization & location fields of user gets grayed because of point 1 once the role is changed.

3. After re-submitting the 'owned by' value of host profile, the default assigned organization and location gets removed from the user profile and need to re-add them.
After re-adding the organization and location to the user profile, the user is again visible under desired organization & location.
Also can be set that user as owner to host which owned by it previously.

Actual results:
1. User is not listed under respective organization/location.
2. Host ownership gets changed to 'Admin'
satellite webui --> Hosts --> All Hosts --> Click on host profile --> Edit --> Additional Information --> 'Owned By'

But the value donot change at satellite webui --> Hosts --> All Hosts --> Click on host profile --> Details --> Owner

3. As the user is locked with hosts details page, it not possible to edit it and re-add the organization/location to it.

Expected results:
After changing the role of user the host ownership still should remain same and the user should be present under the selected organization & location.

Additional info:

Associated revisions

Revision a4d7a037
Added by Marek Hulán 6 months ago

Fixes #12864 - verify host owner taxonomies

History

#1 Updated by Dominic Cleal over 1 year ago

  • Category set to Authorization
  • Priority changed from High to Normal

The steps are rather unclear, it would be useful to reiterate precisely what's being changed. Is it a user editing self?

It sounds like you're describing a visibility issue in the host's owner select list, causing it to be changed.

#2 Updated by Brad Buckingham over 1 year ago

Since the tooling doesn't currently propagate comments between redmine/bugzilla, would you mind raising the question there for the originator? Thanks!

#3 Updated by Marek Hulán 8 months ago

  • Category changed from Authorization to Organizations and Locations

Reproducing steps:

1. create a user not assigned to any org/loc
2. create a host in some org/loc
3. update host owner via hammer (webui would not let you), e.g. hammer host update --owner ares --id a.example.tst

Actual results:

API lets you assign owner from different or none org/loc.

Expected results:

API does not allow you to do this (web ui does not expose such users in select box already). Also webui should check parameters in assigning action, see below.

Additional info:
I tested carefully and it has nothing to do with reassigning role, that seems to work just fine. You can achieve the same bug through webui if you open 2 tabs, in one load the host edit form before you change user orgs/locs, then submit it with old select box. This means we should verify the parameters in assigning action too.

#4 Updated by Marek Hulán 8 months ago

  • Status changed from New to Assigned
  • Assigned To set to Marek Hulán
  • Target version set to Team Marek Iteration 1

#5 Updated by The Foreman Bot 8 months ago

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

#6 Updated by Marek Hulán 8 months ago

  • Target version changed from Team Marek Iteration 1 to Team Marek Iteration 2

#7 Updated by Marek Hulán 7 months ago

  • Target version changed from Team Marek Iteration 2 to Team Marek Iteration 3

#8 Updated by Marek Hulán 6 months ago

  • Target version changed from Team Marek Iteration 3 to Team Marek Iteration 4

#9 Updated by Marek Hulán 6 months ago

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

#10 Updated by Dominic Cleal 6 months ago

  • Release set to 1.14.0

Also available in: Atom PDF