-
- // ensure that the user has access to these custom groups
- $strWhere .= " AND " .
- CRM_Core_Permission::customGroupClause(CRM_Core_Permission::VIEW,
- 'civicrm_custom_group.'
- );
+ if ($checkPermission) {
+ // ensure that the user has access to these custom groups
+ $strWhere .= " AND " .
+ CRM_Core_Permission::customGroupClause(CRM_Core_Permission::VIEW,
+ 'civicrm_custom_group.'
+ );
+ }