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 1341656

Summary: Viewer role user can manage Content Views
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: Users & RolesAssignee: Zach Huntington-Meath <zhunting>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, daviddavis, lpramuk, mhulan, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/15276
Whiteboard:
Fixed In Version: foreman-1.11.0.36-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 10:59:15 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:

Description Lukas Pramuk 2016-06-01 12:31:52 UTC
Description of problem:
User with Viewer role assigned can create/update/publish/promote/remove Content Views, even the existing ones!!!

Version-Release number of selected component (if applicable):
6.2.0-Snap13.1

How reproducible:
always

Steps to Reproduce:
0. Prepare some content, some CVs under admin account
1. Create a user with just Viewer role assigned
2. Login as viewer user and navigate to Content -> Content Views
3. Have a "good play" with admin content

Actual results:
predefined role grants unexpected permissions

Expected results:
predefined role grants only expected permissions

Comment 2 Zach Huntington-Meath 2016-06-02 20:51:28 UTC
Created redmine issue http://projects.theforeman.org/issues/15276 from this bug

Comment 3 Bryan Kearney 2016-06-02 22:17:00 UTC
Upstream bug component is Provisioning

Comment 4 Bryan Kearney 2016-06-03 08:16:53 UTC
Upstream bug component is Users & Roles

Comment 5 Bryan Kearney 2016-06-03 10:17:35 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15276 has been closed

Comment 6 Lukas Pramuk 2016-06-08 18:04:57 UTC
FailedQA.

@Sat6.2.0-Snap15
foreman-1.11.0.36-1.el7sat.noarch

/usr/share/foreman/seeds.d/03-roles.rb:3 
  Permission.all.map(&:name).select { |permission_name| permission_name.match /^view/ }.map(&:to_sym)

Fix is apparently at place but doesn't change anything, behavior is the same.

Is content-view page/items following roles?

Comment 7 Zach Huntington-Meath 2016-06-09 20:30:10 UTC
How was this change tested?

Comment 8 Lukas Pramuk 2016-06-10 11:59:26 UTC
Properly, i.e. the same way as was reported in comment #0

0. Prepare some content, some CVs under admin account
1. Create a user with just Viewer role assigned
2. Login as viewer user and navigate to Content -> Content Views
3. Have a "good play" with admin content

On other pages (Products) user has limited access. Only on CVs page he has not.

>>> permission restrictions are applied but different pages handle it differently (or not at all)

Comment 9 Marek Hulan 2016-06-13 09:58:08 UTC
Was this on clean installation? note that the fix is in data seeding, on existing DB content_views permissions must be removed from viewer role manually.

Comment 10 Lukas Pramuk 2016-06-14 10:02:48 UTC
Verified on clean installation of Satellite

@Sat6.2.0-Snap15.1
foreman-1.11.0.37-1.el7sat.noarch

But it failed on Satellite upgraded from 6.1
It failed for upgraded CVs but also for CVs created after upgrade


Could 03-roles.rb be seeded during Upgrades? (6.1 > 6.2)

Comment 11 Lukas Pramuk 2016-06-14 13:30:14 UTC
VERIFIED.

for fresh Satellite install it is fixed.
for upgraded one it is more tricky as an adminitrator could adjust filters for viewer roles already. 

Thus going to open new BZ where this will be addressed.

Comment 12 David Davis 2016-06-14 16:32:45 UTC
Clearing NEEDSINFO as this bug should answer/fix the problem:

https://bugzilla.redhat.com/show_bug.cgi?id=1346352

Comment 13 Bryan Kearney 2016-07-27 10:59:15 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/RHBA-2016:1501