From 82d4084080c7b963fcda9edec09981a9b42ed87a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 14 Nov 2012 03:02:48 +0100 Subject: [PATCH] Fixed organization search. --- app/controllers/tickets_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 70ce694f3..13333363f 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -470,10 +470,10 @@ class TicketsController < ApplicationController map( &:id ) conditions = [ 'group_id IN (?)', group_ids ] else - if !current_user.organization || !current_user.organization.shared + if !current_user.organization || ( !current_user.organization.shared || current_user.organization.shared == false ) conditions = [ 'customer_id = ?', current_user.id ] else - conditions = [ '( customer_id = ? OR organization_id = ? )', current_user.id, current_user.organization.shared ] + conditions = [ '( customer_id = ? OR organization_id = ? )', current_user.id, current_user.organization.id ] end end