Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1202294

Summary: user can't vew discovery_rules with "Discovery Reader/Manager" role
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: orabin
WebUI sub component: Foreman QA Contact: Sachin Ghai <sghai>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: high    
Priority: unspecified CC: bkearney, lzap, sghai
Version: 6.1.0Keywords: Triaged
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/9895
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 13:58:13 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: 1193977    
Attachments:
Description Flags
I can see the discovery_rule via a normal user none

Description Sachin Ghai 2015-03-16 10:29:17 UTC
Description of problem:
I created a user and assigned "discovery Reader" role to it. When  login with created user, I can see the discovered host but not the discovery_rule.

Version-Release number of selected component (if applicable):
sat6.1 beta snap6 compose2 (Satellite-6.1.0-RHEL-6-20150311.1).

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:
 can see the discovered host but not the discovery_rule with normal user

Expected results:
 discovery rule should be viewable on login with normal user and when "discovery reader role is assigned to normal user

Additional info:

Comment 2 Sachin Ghai 2015-03-16 10:39:21 UTC
Steps to Reproduce: 
0. login with admin user
1. discover a host
2. define a discovery rule
3. create a new user and assign "Discovery Reader" role
4. logout
5. login with new user
6. go to configure --> discovery rules.

Comment 3 Sachin Ghai 2015-03-16 11:34:26 UTC
In another scenario, where I defined "Discovery Manager" role to a user. User can create a new discovery rule with this new role. But as soon as user creates it, rule doesn't listed on UI. The rules list remains empty.

Comment 4 Lukas Zapletal 2015-03-17 14:17:08 UTC
Ori, we need to tune permissions in the engine.rb file.

Comment 5 orabin 2015-03-25 13:09:54 UTC
Created redmine issue http://projects.theforeman.org/issues/9895 from this bug

Comment 8 Bryan Kearney 2015-05-18 12:06:06 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9895 has been closed
-------------
Ori Rabin
Applied in changeset commit:foreman_discovery|0d9cee21e5360614c517176ab0c47ed312018246.

Comment 9 Lukas Zapletal 2015-05-18 12:56:10 UTC
The first PR is:

https://github.com/theforeman/foreman_discovery/pull/173

But we will have another one for this BZ tomorrow.

Comment 10 Sachin Ghai 2015-05-18 13:03:51 UTC
@Bryan: yeah..if a normal user tries to create discovery-rules then UI doesn't show them. Discovery-rules are important part of auto-provisioning which only works for admin, not for a user who has 'Discovery Manager/Reader' role assigned. 

User has workaround either switch to CLI to enable/disable them or swtich to admin account. I strongly feel that its a must-fix for GA.

Comment 14 Sachin Ghai 2015-05-21 12:21:41 UTC
Verified with sat6.1 GA snap5. 

I can see the discovery_rules via Discovery/manager/reader roles. I created a user and assigned Discovery_Manager role. I created a new role and now I can see same rule with reader as well Manager role.  Thanks for fixing this issue.

Comment 15 Sachin Ghai 2015-05-21 12:23:29 UTC
Created attachment 1028119 [details]
I can see the discovery_rule via a normal user

Comment 16 Bryan Kearney 2015-08-11 13:23:23 UTC
This bug is slated to be released with Satellite 6.1.

Comment 17 Bryan Kearney 2015-08-12 13:58:13 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.