Skip to content

Draft: Hide the display of email addresses on the user profile page for specific groups

What does this MR do and why?

This MR will hide the display of a user's public email if any group they belong to has email_visibility_disabled set to true.

The intent is groups that a user belongs to can still opt to hide the visibility of a group member's public email.

Screenshots or screen recordings

User who does NOT belong to any group that has attr set to true User who has belongs to a group with attr set to true
Screen_Shot_2022-02-01_at_20.40.55 Screen_Shot_2022-02-01_at_20.40.46

How to set up and validate locally

  1. Run db migrations bin/rails db:migrate RAILS_ENV=development
  2. In rails console
    Feature.enable(:hide_public_email_on_profile)
  3. Pick a group to test on, e.g., Flightjs (ID 26)
  4. In rails console
    group = Namespace.find(26)
    group.update_attribute(:email_visibility_disabled, true)
  5. Pick from group's users to test on. Impersonate them, and set their email as a public one to use in their profile settings.
  6. Select a control user, e.g., donette (http://localhost:3000/admin/users/donette), who does not belong to Flightjs. Make sure they also have a public email set.
  7. View the profiles of rob and donette.
    • Observe that rob's email does not display even though it is set as public.
    • Observe that donette is displayed since it is set as public.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/351723

Edited by Dennis Tang

Merge request reports