optimize permission checks for groups in SearchHelper

fixes CNVS-11231

Change-Id: Ic48d019e43add3498535d3fde84d3dfebc0e734f
Reviewed-on: https://gerrit.instructure.com/31048
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>