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.
Created from redmine issue http://projects.theforeman.org/issues/15585
Upstream bug assigned to orabin
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)
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.
Moving to POST since upstream bug http://projects.theforeman.org/issues/15585 has been closed
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:
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