Bug 1145814

Summary: unable to create a role filter
Product: Red Hat Satellite Reporter: Tom McKay <tomckay>
Component: Users & RolesAssignee: Marek Hulan <mhulan>
Status: CLOSED CURRENTRELEASE QA Contact: sthirugn <sthirugn>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: bbuckingham, bkearney, cwelton, dcleal, stbenjam, sthirugn
Target Milestone: UnspecifiedKeywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/7615
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 14:01:23 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:

Description Tom McKay 2014-09-23 20:17:58 UTC
As admin, visit try creating a new role filter in the UI for resource type Role. After submit no error message is displayed but the create page remains (versus normal behavior of returning to full list of filters). Looking at log an error is present of "Failed to save: Organization ids You can't assign organizations to this resource".

Comment 1 Tom McKay 2014-09-23 20:17:59 UTC
Created from redmine issue http://projects.theforeman.org/issues/7615

Comment 3 Dominic Cleal 2014-09-24 08:01:39 UTC
No such code in this version to even produce this error.

Comment 4 sthirugn@redhat.com 2015-04-04 10:38:42 UTC
1. Create a filter
 - Resource Type - Organization
 - Permission - view_organizations
 - Uncheck Unlimited
 - Search = name = "Default Organization"
2. Click Submit

Noticed the following in the logs: 

[I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"uS23C6Kl4xympo5DfKgrgnHFcW+A079vHG8sNAb0XSc=", "filter"=>{"role_id"=>"16", "resource_type"=>"Organization", "permission_ids"=>["", "105"], "unlimited"=>"0", "search"=>"name =  \"Default Organization\"", "location_ids"=>[""], "organization_ids"=>["", "", ""]}, "role_id"=>"16", "commit"=>"Submit"}
2015-04-04 12:37:13 [I] Failed to save: Organization ids You can't assign organizations to this resource

Note: This works fine for Resource Type = Activation keys.

Because of this bug, I cannot create roles specific to organizations.  I think this is a high severity bug which needs to be fixed by 6.1

Comment 7 sthirugn@redhat.com 2015-04-04 13:28:22 UTC
This works fine in cli though:

UI makes the following api call:
Parameters: {"utf8"=>"✓", "authenticity_token"=>"uS23C6Kl4xympo5DfKgrgnHFcW+A079vHG8sNAb0XSc=", "filter"=>{"role_id"=>"16", "resource_type"=>"Organization", "permission_ids"=>["", "109", "185", "106", "188", "108", "107", "187", "186", "105", "184"], "unlimited"=>"0", "search"=>"name = sthirugn-enablemanifest", "location_ids"=>[""], "organization_ids"=>["", "", ""]}, "role_id"=>"16", "commit"=>"Submit"}

CLI makes the following api call:
Processing by Api::V2::FiltersController#create as JSON
2015-04-04 14:35:51 [I]   Parameters: {"filter"=>{"role_id"=>"1", "permission_ids"=>["105", "106", "107", "108", "109", "184", "185", "186", "187", "188"], "search"=>"name =  sthirugn-enablemanifest"}, "apiv"=>"v2"}

Comment 8 Stephen Benjamin 2015-04-07 08:55:45 UTC
*** Bug 1208604 has been marked as a duplicate of this bug. ***

Comment 9 Stephen Benjamin 2015-04-07 08:56:44 UTC
This prevents non-admin users from subscribing to mail notifications.

Comment 10 Bryan Kearney 2015-04-08 12:04:00 UTC
Upstream bug assigned to mhulan

Comment 11 Bryan Kearney 2015-04-09 12:04:06 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/7615 has been closed
-------------
Marek Hulán
Applied in changeset commit:76fca93b0093e9b4174d1a888ffca9f3fcb886c9.

Comment 13 sthirugn@redhat.com 2015-04-27 13:54:38 UTC
Verified as per the steps mentioned in Comment 4.

Satellite-6.1.0-RHEL-6-20150424.0

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

Comment 15 Bryan Kearney 2015-08-12 14:01:23 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.