Skip to content

Selectively hide public email on profile page

Alex Pooley requested to merge ap-hide-public-email into master

What does this MR do and why?

This MR will hide the display of a user's public email if the feature flag hide_public_email_on_profile has been set to true for the group actor equal to the value of the user's provisioned_by_group.

This is a short term work around.

Screenshots or screen recordings

Feature flag disabled Feature flag enabled for provisioned_by_group
Screen_Shot_2022-02-02_at_3.09.54_pm Screen_Shot_2022-02-02_at_3.11.13_pm

How to set up and validate locally

  1. In rails console
    group = FactoryBot.create(:group)
    scim_identity = FactoryBot.create(:scim_identity, group: group)
    user = FactoryBot.create(:user, :public_email, provisioned_by_group_id: scim_identity.group.id)
    Feature.disable(:hide_public_email_on_profile)
  2. Visit profile page for user E.g. http://localhost:3000/test-user
  3. Observe user email is displayed.
  4. In rails console
    Feature.enable(:hide_public_email_on_profile, group)
  5. Observe user email is not displayed.

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 Alex Pooley

Merge request reports