Bug 1489324

Summary: [CLI and API] Functionality of Assigning role to the user is missing
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Users & RolesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, bkearney, brubisch, dhlavacd, jyejare, lzap, mhulan, pcreech
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1122832, 1373844    

Comment 4 Jitendra Yejare 2017-09-12 06:43:56 UTC
I dont think so its regression because I can see this in 6.2.z recent snaps as well.

Also the reason I set blocker because its the complete and basic functionality missing from hammer end.

Comment 6 Jitendra Yejare 2017-09-13 11:21:33 UTC
Same issue observed from API end as well.

Comment 7 Jitendra Yejare 2017-09-13 11:23:07 UTC
This issue is affecting test case execution/automation of 6.3 feature from API and CLI end. And that is the reason We would like to get this in 6.3

Comment 9 Marek Hulan 2017-09-13 18:51:40 UTC
Created redmine issue http://projects.theforeman.org/issues/20913 from this bug

Comment 11 Satellite Program 2017-09-13 20:05:54 UTC
Upstream bug assigned to mhulan

Comment 12 Satellite Program 2017-09-13 20:05:58 UTC
Upstream bug assigned to mhulan

Comment 13 Satellite Program 2017-09-14 08:06:04 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20913 has been resolved.

Comment 17 Jitendra Yejare 2017-12-04 10:43:45 UTC
Marek,

I saw that functionality is working from API end but somehow I don't see any options from hammer CLI to update the role of the user or while creating the user.

Is this expected? If yes, I think I cannot verify this bug as it also has CLI component in it to be fixed.

Comment 18 Marek Hulan 2017-12-07 12:48:16 UTC
Jitendra, did you try hammer -r user create --help? The cache of API must be reloaded if you created it in with version. I can see --role-ids and --roles and verified it works with latest snap.

satellite-6.3.0-22.0.el7sat.noarch
tfm-rubygem-hammer_cli-0.11.0.1-1.el7sat.noarch

Comment 19 Jitendra Yejare 2017-12-07 13:25:57 UTC
@Marek,

Yeah Actually I had satellite 6.3 which was upgraded from 6.3 last snap (i.e snap 26 to snap 27), may be some issues with it.

But I am checking on some other system, where I can see role options in create and update as well.

Create:
----------------

# hammer user create --login user_verify --mail r.u --password changeverify --auth-source-id 1 --role-ids 36
User [user_verify] created
# hammer user info --login user_verify
Id:                    9
Login:                 user_verify
Name:                   
Email:                 r.u
Admin:                 no
Last login:            
Authorized by:         Internal
Effective admin:       no
Locale:                default
Timezone:              default
Description:           
Default organization:  
Default location:      
Roles:                 
    Default role
    role_verify
User groups:           

Inherited User groups: 

Created at:            2017/12/07 13:18:56


Update:
----------

# hammer user update --login user_verify --role-ids 36
User [user_verify] updated
# hammer user info --login user_verify
Id:                    9
Login:                 user_verify
Name:                   
Email:                 r.u
Admin:                 no
Last login:            
Authorized by:         Internal
Effective admin:       no
Locale:                default
Timezone:              
Description:           
Default organization:  
Default location:      
Roles:                 
    Default role
    role_verify
User groups:           

Inherited User groups: 

Created at:            2017/12/07 13:18:56
Updated at:            2017/12/07 13:22:04


So as per comment 17, 18 and above hammer data, both CLI and API has options to update the role in user and create user with role is present.

Comment 20 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336