Change record status: 
Project: 
Introduced in branch: 
9.2.x
Introduced in version: 
9.2.0
Description: 

The following new permission was added to allow non-administrators to view another user's email address:

view user email addresses

It's disabled for all roles except administrator by default and can be enabled for any other user role.
After enabling this permission, users will be able to see the email addresses on user pages, but also other places where user email addresses might be shown, including Views and JSON:API responses.

Administer permission access user mail

AttachmentSize
Administer permission View user email210.16 KB
Impacts: 
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers

Comments

piridium’s picture

I'm on 8.8.1 and the permission is not showing up. Did clear the cache multiple times. What am I doing wrong?

zwerg’s picture

Same here on 8.9.3 - would it be fixed in the future?

stevenpatz’s picture

upgrade to Drupal 9.2

ressa’s picture

@piridium: The reason is that this Change Record was a draft, and only updated today, when the change was released in Drupal 9.2: https://www.drupal.org/node/3070293/revisions/view/12232232/12259712

andypost’s picture

andypost’s picture

Final commit

gconry’s picture

Any chance of creating a patch for 9.1?

rpearl’s picture

I am on Drupal Core 9.2.2 and have enabled this option for all Authenticated Users (have also just left it for Admins) and we are not seeing the email address on the View User details page. Are there other required steps in order to see the email address? I was looking in the people configuration pages and was not seeing anything in there either that allows this to show. I must be missing something here.

rpearl’s picture

Seems it was as easy as copying and putting the user.html.twig file into our theme template with the below:

...
{% if content %}
  {{- content -}}
  <strong>Email:</strong><br/>
  {{ user.mail.value }}
{% endif %}
...

I am assuming the new permission allows the email field to be accessible via the user data and does not make it display by default. Hope this helps someone else who had a brain fart this past week!

capysara’s picture

Thanks! I was also looking for it to be available in the UI. Editing the user twig seems like the way to go.