Prevent Users from Changing Their E-mail Address

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This KB will help admins to hide the email field from User Profiles for all Confluence users who are not part of the confluence-administrator group, therefore preventing them from changing their e-mail address.

Solution

The below steps will help admins hide the option for users to change their e-mail address by hiding the field entirely. They will still be able to edit other User Profile details. 

  • How to hide the email field for users that are not members of confluence-admin group. (If you want to expose the field for another particular group, replace confluence-administrator with the group name or add another group in addition to confluence-administrator.)

    • Site-wide changes
      • Navigate to Confluence Administration page >> Layout.

      • Under Site Layouts, search for Main Layout and click Edit/Create Custom.

      • tags.">Find the following section: <head> and </head> tags.

      • tag.">Copy and paste the following code before the </head> tag.

        • #if ($userAccessor.hasMembership('confluence-administrators', $helper.action.remoteUser.name))
          #else
              <script type="text/javascript">
              AJS.toInit(function(){
          AJS.$('#email-label').hide();
          AJS.$('#email').hide();
              });
          </script>
          #end

 Please test these customizations in a Staging Instance first. Once the customization is applied, users who are not part of confluence-administrators group will not be able to see or edit their email in their User Profile page.

Last modified on Feb 22, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.