private function getRepNonAdminAccessQuery($module, $user, $parentRole, $userGroups) { $query = CRMEntity::getNonAdminUserAccessQuery($user, $parentRole, $userGroups); if (!empty($module)) { $moduleAccessQuery = CRMEntity::getNonAdminModuleAccessQuery($module, $user); if (!empty($moduleAccessQuery)) { $query .= " UNION {$moduleAccessQuery}"; } } return $query; }