Bug 1245624

Summary: Taxonomy selectors are empty even for users with assign permissions
Product: Red Hat Satellite Reporter: Marek Hulan <mhulan>
Component: ProvisioningAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: bbuckingham, jyejare, mhulan, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/11187
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 08:54:01 UTC Type: ---
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: 1136910    

Description Marek Hulan 2015-07-22 12:18:32 UTC
A "patch":https://github.com/theforeman/foreman/commit/887e2fd9 that added authorization to multiple selects broke the taxonomies selects. It calls authorized without any arguments which means it check for any permission for a default resource (which is self). This can't work for Taxonomy (and other STI models) because permissions are mapped to children resources. Also I think that there should be view_$resource permission checked instead of any permission (not 100% sure about this though).

Comment 1 Marek Hulan 2015-07-22 12:18:33 UTC
Created from redmine issue http://projects.theforeman.org/issues/11187

Comment 3 Bryan Kearney 2015-08-14 17:02:06 UTC
Upstream bug assigned to mhulan

Comment 6 Jitendra Yejare 2016-05-04 09:20:04 UTC
Please provide repro steps from QE/user perspective.

Comment 7 Marek Hulan 2016-05-05 10:40:21 UTC
Steps to verify

1. create a user (not admin) with view_organizations and assign_organizations permissions filtered with expression 'name ~ visible*'.
2. create 3 organizations with names "visible1", "visible2", "hidden"
3. put user to organization visible1
4. create some taxable resource, e.g. domain and assign it to organizations visible1 and hidden
5. make sure user have permissions to view and edit the resource
6. make sure the user does not have other roles giving him full access to organizations (e.g. Manager role)
7. log in as user and edit the resource (domain), in the form you should see Organizations tab listing only visible1 and visible2, assign them both
8. it should save the resource
9. re-login as admin and verify that the resource belongs to visible1, visible2 and also it remained assigned to hidden organization

Without the fix, you'd always see empty list of organizations as user.

Comment 8 Jitendra Yejare 2016-07-19 10:59:51 UTC
Verified !

@ Sat 6.2 Snap 20.2 GA

Followed steps from Comment 7 and I observed the expected behavior mentioned in step 9 as : 
After re-login as admin and verified that the resource belongs to visible1, visible2 and remained assigned to hidden organization as well.

So moving this BZ to verified state!

Comment 10 errata-xmlrpc 2016-07-27 08:54:01 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:1500