Bug 1353465

Summary: Parameters api call from host info command prevents showing any host details
Product: Red Hat Satellite Reporter: orabin
Component: HammerAssignee: orabin
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney, cwelton, ehelms, inecas, rplevka
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 17:10:00 UTC Type: ---
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: 1296662    
Bug Blocks:    

Description orabin 2016-07-07 08:04:37 UTC
This code should be removed: https://github.com/theforeman/hammer-cli-foreman/blob/master/lib/hammer_cli_foreman/host.rb#L181
now that http://projects.theforeman.org/issues/5820 has been closed.

Now that parameters have their own permissions this second call when returning unauthorized will prevent showing any details on the host instead of just removing the parameters.

Comment 1 orabin 2016-07-07 08:04:41 UTC
Created from redmine issue http://projects.theforeman.org/issues/15585

Comment 2 orabin 2016-07-07 08:04:46 UTC
Upstream bug assigned to orabin

Comment 4 Roman Plevka 2016-07-11 11:12:15 UTC
QA Note - verification procedure for this one should be as follows:

1. create some host(s)
2. create a non-admin user with `view_hosts` role
3. do `hammer host info --id <host_id>

there shouldn't be an error (with refusing to process the request), but the info about a host should be listed (without the 'Parameters' section)

Comment 6 Bryan Kearney 2016-07-12 13:26:24 UTC
Replacing this with the simpllified version from https://bugzilla.redhat.com/show_bug.cgi?id=1354572. In 6.3 we should re-apply this bug.

Comment 7 Bryan Kearney 2016-08-02 10:16:32 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15585 has been closed

Comment 8 Roman Plevka 2017-10-26 15:06:52 UTC
VERIFIED
on sat6.3.0-#21

# hammer user info --login nonadmin
Id:                    34
Login:                 nonadmin
Name:                   
Email:                 
Admin:                 no
Last login:            
Authorized by:         Internal
Effective admin:       no
Locale:                default
Timezone:              
Description:           
Default organization:  Default Organization
Default location:      
Roles:                 
    View hosts
    Default role
User groups:           

Inherited User groups: 

Locations:             
    Default Location
Organizations:         
    Default Organization
Created at:            2017/10/26 15:04:53
Updated at:            2017/10/26 15:04:53

# hammer -u nonadmin -p changeme host info --id 1520
Id:                       1520
Name:                     erik-culler.rhts.eng.bos.redhat.com
Organization:             Default Organization
Location:                 Default Location
Host Group:               discovered
Puppet CA Id:             
Puppet Master Id:         
Cert name:                erik-culler.rhts.eng.bos.redhat.com
Managed:                  yes
Installed at:             
Last report:              
Network:                  
    IP:     192.168.100.26
    MAC:    52:54:00:bc:b2:f8
    Subnet: Default Subnet
    Domain: rhts.eng.bos.redhat.com
Network interfaces:       
 1) Id:          1523
    Identifier:  
    Type:        interface (primary, provision)
    MAC address: 52:54:00:bc:b2:f8
    IP address:  192.168.100.26
    FQDN:
Operating system:         
    Architecture:           x86_64
    Operating System:       RHEL Server 7.4
    Build:                  yes
    Partition Table:        Kickstart default
    Custom partition table:
Parameters:               

All parameters:           

Additional info:          
    Owner Id:   3
    Owner Type: User
    Enabled:    yes
    Comment:
OpenSCAP Proxy:           
Content Information:      
    Content View:          Default Organization View
    Lifecycle Environment: Library
    Content Source:        cisco-b420m3-01.rhts.eng.bos.redhat.com
    Applicable Packages:   0
    Upgradable Packages:   0
    Applicable Errata:     
        Enhancement: 0
        Bug Fix:     0
        Security:    0
Subscription Information: 
    UUID:            
    Last Checkin:    
    Service Level:   
    Release Version: 
    Autoheal:        
    Registered To:   
    Registered At:
Host Collections:

Comment 9 Bryan Kearney 2018-02-21 17:10:00 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