Bug 1652961

Summary: blank affected organizations/locations for restricted user
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Audit LogAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: egolov, inecas, mhulan
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.20.1.19-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:39:05 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:
Attachments:
Description Flags
screenshot none

Description Roman Plevka 2018-11-23 17:17:08 UTC
Created attachment 1508300 [details]
screenshot

Description of problem:
as a restricted user with a cloned "auditor" role (assigned to the same org as user) with added "view_organizations/locations" filters,
the `affected organizations` and `affected locations` fields remain blank.

The audit records seem to respect the taxonomies though (they are filtered on switching the org/loc context)

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


Steps to Reproduce:
1. create new org
2. clone auditor role and assign it to the new org and add view_organizations, view_locations filters to it
3. create user inside the new org and assign him the cloned role
4. as Admin, create some entity (if taxable, make sure you create them in the new org)
5. as Admin, verify the audit record was created for the action and that the audit contains the "affected orgs/locs" values

6. as New User, verify the created audits.

Actual results:
Affected Organizations, Locations are blank

Expected results:
applicable organizations/locations should be displayed (respecting the users taxonomy membership)

Additional info:

Comment 2 jcallaha 2018-11-27 18:39:21 UTC
This seems very similar to the bug identified in https://bugzilla.redhat.com/show_bug.cgi?id=1646740.

Is the fix for the above bug not included in the latest build of 6.5?

Comment 3 Marek Hulan 2019-02-12 08:25:47 UTC
Created redmine issue https://projects.theforeman.org/issues/26034 from this bug

Comment 4 Bryan Kearney 2019-03-07 11:03:00 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 5 Bryan Kearney 2019-03-07 11:03:01 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 6 Marek Hulan 2019-03-08 11:39:09 UTC
This is caused by the fact, auditor role does not grant view_locations and view_organizations permissions. The patch will let these be displayed if user is assigned to such locs/orgs.

Comment 8 Roman Plevka 2019-03-19 14:45:08 UTC
VERIFIED
on sat6.5.0-20

the affected orgs and locs are now visible

Comment 11 errata-xmlrpc 2019-05-14 12:39:05 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-2019:1222