Patch #37994

Unify link to user/group in application helper

Added by Dmitry Makurin 2 months ago. Updated about 1 month ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


After r21073 was introduced application helper has multiple methods to render user/group links:
  • link_to_user
  • link_to_principal
  • link_to_group

The link_to_principal method combines the functionality of the other two. They don't have much use right now. I propose to unify all 3 methods in one.

An attached patch removes link_to_user and link_to_group methods and adds two aliases to link_to_principal (user and group respectively).

link_to_group was used to redirect admin user to edit group page which is obsolete since all users have access to show group page and there is an edit link for admin.

Patch also adds a new test to confirm edit link presence for admins.

37994.patch Magnifier (3.52 KB) Dmitry Makurin , 2022-12-05 17:12

Related issues

Related to Redmine - Feature #12795: View group members by non-admin users Closed


#1 Updated by Dmitry Makurin 2 months ago

#2 Updated by Holger Just about 1 month ago

  • Related to Feature #12795: View group members by non-admin users added

#3 Updated by Holger Just about 1 month ago

This changes the behavior in that the aliases link_to_group now links to the group's show page, rather than its edit page. As far as I'm aware, the only place where we call link_to_group today is in app/views/users/show.html.erb template. Here, this change is probably okay.

(We might want to improve the groups#show page a bit however, e.g. by adding links to the member users there. This is mostly unrelated to this here issue though.)

Also available in: Atom PDF