Skip to content
Permalink
Browse files Browse the repository at this point in the history
ZBUG-1094:Broken GAL search filtering
  • Loading branch information
sneha-patil-synacor authored and rupalid committed Feb 24, 2020
1 parent 9e80c50 commit 1df440e
Showing 1 changed file with 9 additions and 3 deletions.
@@ -1,7 +1,7 @@
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016 Synacor, Inc.
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016, 2020 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
Expand Down Expand Up @@ -57,8 +57,14 @@ public Element handle(Element request, Map<String, Object> context) throws Servi
params.setLimit(account.getContactAutoCompleteMaxResults());
params.setNeedCanExpand(needCanExpand);
params.setResponseName(AccountConstants.AUTO_COMPLETE_GAL_RESPONSE);
if (galAcctId != null)
params.setGalSyncAccount(Provisioning.getInstance().getAccountById(galAcctId));
if (galAcctId != null) {
Account galAccount = Provisioning.getInstance().getAccountById(galAcctId);
if (galAccount != null && (!account.getDomainId().equals(galAccount.getDomainId()))) {
throw ServiceException
.PERM_DENIED("can not access galsync account of different domain");
}
params.setGalSyncAccount(galAccount);
}
GalSearchControl gal = new GalSearchControl(params);
gal.autocomplete();
return params.getResultCallback().getResponse();
Expand Down

0 comments on commit 1df440e

Please sign in to comment.