Hides a user's email and login from everyone except:
- admins,
- the user themselves,
- members of a configurable staff group.
Everyone else (anonymous visitors, customers) still sees the profile page and
the /users/:id.json API response, just without those fields.
- Email: hidden everywhere Redmine checks "Hide my email address": the
profile page, the users API, Atom feeds, and plugins that honour the same
preference (e.g. additionals'
{{members}}/{{group_users}}macros). A user who ticked "Hide my email address" keeps it hidden from staff too; admins still get it through the API, as in core. User autocompletes (watchers, mentions, members, zenedit) no longer match on email for these viewers, so a guessed address can't be confirmed by typing it. - Login: hidden on the profile page and in the users API only. Logins still appear in @mentions, mention autocomplete and some plugin macros, so treat this as reducing exposure, not as a secret.
Which users anyone can open at all is still governed by core's per-role "Users visibility" setting.
- Put the plugin in
plugins/redmine_plugin_user_visibility(the directory name must match the registered plugin id). - Restart Redmine.
- Administration > Plugins > Redmine User Visibility Restriction > Configure: pick the staff group. Until a group is chosen, only admins and the user themselves see logins and emails. If the chosen group is later deleted, the settings page says so.
- Email:
UserPreference#hide_mailreads as true for viewers who may not see the user's details. Only the reader changes; the stored value, and what the user sees on their own account page, stay as they are. - Autocomplete:
Principal.likekeeps core's matching, narrowed to login and name matches for viewers who may not see emails. - Login: the plugin overrides
users/show.html.erbandusers/show.api.rsbwith copies of Redmine 6.1's views in which only the login line is changed.test/unit/view_overrides_test.rbundoes that edit and compares the result with the running Redmine's own views, so a Redmine upgrade that changes either view fails the test; refresh the copies from the new core views and re-apply the edit.
Side effects: three core tests fail with the plugin installed, by design.
Two users API tests (test/integration/api_test/users_test.rb) expect a
non-admin to get another user's login, and
PrincipalTest#test_like_scope_should_search_mail expects user search to
match emails for a non-staff viewer.
From the Redmine root:
bundle exec rails test plugins/redmine_plugin_user_visibility/test
- Redmine 6.1 and 7.0