Project

General

Profile

Actions

Bug #19936

closed

User has to have Unlimited Hosts view permission to be able to view output for a host

Added by Adam Ruzicka almost 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Foreman
Target version:
-
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1412025

Description of problem:

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

How reproducible:

Steps to Reproduce:
1. Create a job
2. Create a user, and assign the user a role with permissions to execute job invocation "name = <jobname> AND host.name = examplehost", and permissions to view only "name = examplehost"
3. Try and look at the status for the specific host(/api/job_invocations/<invoc_id>/hosts/<examplehost_id>, and it fails with " "error": {"message":"undefined method `profile=' for nil:NilClass"}"

Actual results:
It fails with error : {"message":"undefined method `profile=' for nil:NilClass"}"

Expected results:
Should execute the job without any error

Additional info:
- When running job without host id
https://satellite.example.com/api/v2/job_invocations/122

{"id":122,"description":"Run date","job_category":"Commands","targeting_id":122,"status":0,"start_at":"2017-01-11 01:18:34 UTC","status_label":"succeeded","dynflow_task":{"id":"f7dc5e04-4978-4205-bffb-83f641d82664","state":"stopped"},"succeeded":1,"failed":0,"pending":0,"total":1,"targeting":{"bookmark_id":null,"search_query":"name = dhcp9-193.gsslab.pnq.redhat.com","targeting_type":"static_query","user_id":3,"hosts":[{"name":"dhcp9-193.gsslab.pnq.redhat.com","id":64}]},"template_invocations":[{"template_id":94,"template_name":"Run Command - SSH Default","template_invocation_input_values":[{"template_input_name":"command","template_input_id":7,"value":"date"}]}]}

- When running job with host id
https://satellite.example.com/api/v2/job_invocations/122/hosts/64 {
"error": {"message":"undefined method `profile=' for nil:NilClass"}
}

Please check the attached screen shots more information.

Actions #1

Updated by Adam Ruzicka almost 7 years ago

  • Subject changed from Satellite 6.2: User has to have Unlimited Hosts view permission to be able to lookup a job status using API to User has to have Unlimited Hosts view permission to be able to view output for a host
  • Category set to Foreman
  • Target version set to 113
Actions #2

Updated by Ivan Necas over 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Shimon Shtein
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/266 added
Actions #3

Updated by Ivan Necas over 6 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF