Bug 1488908 - [CLI and API] Role cloning, copies its taxonomies as well
Summary: [CLI and API] Role cloning, copies its taxonomies as well
Status: VERIFIED
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Users & Roles
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: 6.6.0
Assignee: Dominik Hlavac Duran
QA Contact: vijsingh
URL:
Whiteboard:
Keywords: Reopened, Triaged
Depends On:
Blocks: 1373844
TreeView+ depends on / blocked
 
Reported: 2017-09-06 12:47 UTC by Jitendra Yejare
Modified: 2019-06-27 18:28 UTC (History)
6 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-10-03 19:17:38 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 21545 None None None 2017-11-01 12:59 UTC

Description Jitendra Yejare 2017-09-06 12:47:28 UTC
Description of problem:
From Hammer CLI, If you clone a role that has taxonomies, then after cloning the same taxonomies are copied over to the cloned role.

This behavior is not same from UI


Version-Release number of selected component (if applicable):
Satellite 6.3.0 snap 14

How reproducible:
Always

Steps to Reproduce:
1. Create a role with org A and location A
2. Clone above role from hammer CLI without providing any org and location id's
# hammer role clone --id 45 --new-name clied_cloned

Actual results:
The cloned role has taxonomies copied from its parent role

Expected results:
Cloned role should not have any taxonomies

Additional info:

Comment 2 Jitendra Yejare 2017-09-14 12:40:17 UTC
This issue is reproducible from API end as well.

Also, this issue is affecting 6.3 feature 'Canned Role Org Admin' from API end.

Comment 3 Ondřej Pražák 2017-11-01 12:59:46 UTC
Created redmine issue http://projects.theforeman.org/issues/21545 from this bug

Comment 5 Bryan Kearney 2018-10-03 19:17:38 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 6 Jitendra Yejare 2018-10-09 08:56:49 UTC
This was really required to fix as its the basics of satellites role-based authentication. This is affecting the way role filter behaves after cloning and hence need to fix. 

Reopening as per discussion with MHulan.

Comment 7 Bryan Kearney 2018-11-01 14:43:48 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is  not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Rich Jerrido or Bryan Kearney or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 8 Bryan Kearney 2018-11-06 13:20:52 UTC
This is a work in progress upstream per Marek. We will keep this open and not close it.

Comment 9 pm-sat@redhat.com 2018-12-17 15:08:08 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/21545 has been resolved.

Comment 11 Ondřej Pražák 2019-06-04 10:49:47 UTC
The patch should fix inconsistencies, organizations and locations are now assigned to the cloned role by default in both API/UI. If you need to modify what orgs/locs the clone has, it can be done by selecting/deselecting items in UI before the form is submitted or by passing --locations and --organizations flags to the hammer command.

Running 'hammer role clone --id 30 --new-name cloned_role' will assign all the organizations and locations from role with id 30 to cloned_role.
In UI, the form for clone should have preselected the taxonomies from the original role.

Comment 12 vijsingh 2019-06-04 12:25:15 UTC
ON_QA Verified:

@Satellite 6.6.0 snap 5.0

Steps:
A. with CLI:

 1. Created a role with org A and location A
 2. Clone above role from hammer CLI without providing any org and location id's

~~~~~~~~~~~~~~~~~~~~~~
[root@intel-canoepass-09 ~]# hammer role clone --id 30 --new-name clone_test
User role cloned.
[root@intel-canoepass-09 ~]# hammer role info --id 31
Id:            31
Name:          clone_test
Builtin:       no
Description:   
Locations:      
    Default Location            <=========
Organizations: 
    Default Organization        <=========

~~~~~~~~~~~~~~~~~~~~~~

B. With UI also observed the same.
 
  Screenshot attached


Observation:

 The cloned role has taxonomies copied from its parent role from CLI/UI too.

Comment 13 vijsingh 2019-06-04 12:49 UTC
Created attachment 1577052 [details]
Screenshots


Note You need to log in before you can comment on or make changes to this bug.