[go: up one dir, main page]

Skip to content

Enable user searching by partial email for administrator accounts

Description

Some time ago the searching by partial email was removed from Gitlab (gitlab-ce#34910)

It was the very useful feature for us. We were filtering the employees and then fetching their activity (contributions) via the API, but now it is not possible.

Proposal

Could you please enable this feature for the administrator accounts?

Links / references

E-mail address disclosure through member search fields (gitlab-foss#34910 (closed))

Implementation Guide

It's possible to try with where(fuzzy_arel_match(:email, query, use_minimum_char_limit: options[:use_minimum_char_limit]) but care needs to be taken to limit only to administrators

  1. Modify User.search to accept a new partial_email_query option
  2. Combine with_public_email and with_primary_or_secondary_email to a new method, for ease of updating later.
  3. Pass partial_email_query option to new method from 2.
  4. If partial_email_query, use fuzzy_arel_match, otherwise use current code that matches exactly
  5. In the relevant places where User.search is called, set partial_email_query: true if the current user is an admin.
Edited by Thong Kuah