Bug 1472863

Summary: Searching for specific organizations/locations broken
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: SearchAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, ehelms, kgaikwad, mhulan, rplevka
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/19707
Whiteboard:
Fixed In Version: scoped_search-4.1.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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: 1373844    

Description Jitendra Yejare 2017-07-19 14:41:41 UTC
If I try to search through subnets with location_id every subnet is returned as long as the location_id actually exists. If I search for a nonexsitent location_id no subnet gets returned.
Also searching for organizations seems to be broken too, because when I enter a location name as organization I get a list of all subnets.


Examples:

Subnet1:
  name: net1-mgmt
  location_id: 8

Subnet2:
  name: net2-mgmt
  location_id: 9


search_string: location_id = 9 and name ~ net%-mgmt

Result: Both Subnets
Expected Result: Subnet2


search_string: location_id = 90 and name ~ net%-mgmt

Result: Nothing
Expected Result: Nothing (this is actually correct)


search_string: organization_id = 9 and name ~ net%-mgmt

Result: Both Subnets
Expected Result: Nothing as organization_id 9 does not exist

Comment 1 Jitendra Yejare 2017-07-19 14:41:45 UTC
Created from redmine issue http://projects.theforeman.org/issues/19707

Comment 4 Satellite Program 2017-08-25 16:14:25 UTC
Upstream bug assigned to oprazak

Comment 5 Ondřej Pražák 2017-08-31 11:08:45 UTC
*** Bug 1479885 has been marked as a duplicate of this bug. ***

Comment 6 Jitendra Yejare 2017-10-25 10:04:44 UTC
Verified!

@ Satellite 6.3 snap 21

Steps:
Same as mentioned in Description

Behavior: 
The number of filters in 'Organization Admin' roles in upgraded 6.3 and freshly installed satellite are same.

Comment 7 Jitendra Yejare 2017-10-25 10:14:16 UTC
Sorry I accedently updated this bug instead of https://bugzilla.redhat.com/show_bug.cgi?id=1501414

Moving back to ON_QA.

Comment 8 Jitendra Yejare 2017-10-25 13:15:29 UTC
Verified!

@Satellite 6.3 snap 21

Steps:

Scenario 1:
------------------------

Subnet1:
  name: net1-mgmt
  location_id: 8

Subnet2:
  name: net2-mgmt
  location_id: 9


search_string: location_id = 9

Result: subnet2
Expected Result: Subnet2


search_string: location_id = 90

Result: Nothing
Expected Result: Nothing


search_string: organization_id = 9

Result: Nothing
Expected Result: Nothing


Scenario2:
------------------

1. Created Org Admin role and assigned any taxonomies to it
2. Created user and assigned above Org Admin role to it
3. Login with above Org Admin user
4. Go to Context Switcher, check if 'Manage Organizations' links are available

Result:
Manage Organizations option is not available and manage locations option is available as expected.

Hence changing the state to Veriifed as the results are expected.

Comment 9 Satellite Program 2018-02-21 16:54:17 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-2018:0336