mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 08:06:08 +10:00
Merge branch 'add_show_role_boolean_to_group_member_view' into 'master'
Only show group member roles if explicitly requested This very simply fixes an EE problem, but I made the change here so it's less prone to errors from merges. In EE, prior to this change, group member roles were shown in project member list when a project is shared with a group. This is bad because the project explicitly shares with the group and sets a 'max access' level. If the max access level is 'developer' the project owner doesn't want to see 'Owner' in the group roles because it will confuse them. I verified that permissions are really being honored here, it was just an error in the view. You can see in https://gitlab.com/gitlab-org/gitlab-ee/blob/master/app/views/projects/project_members/_shared_group_members.html.haml#L18 where this was how it was intended to be. Likely a CE-EE merge introduced this bug. That's why I made the boolean required in CE even though this is for EE. ## Before  ## After  See merge request !3044
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
- user = member.user
|
||||
- return unless user || member.invite?
|
||||
- show_roles = local_assigns.fetch(:show_roles, true)
|
||||
|
||||
%li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)}
|
||||
%span{class: ("list-item-name" if show_controls)}
|
||||
@@ -28,7 +29,7 @@
|
||||
= link_to resend_invite_group_group_member_path(@group, member), method: :post, class: "btn-xs btn", title: 'Resend invite' do
|
||||
Resend invite
|
||||
|
||||
- if should_user_see_group_roles?(current_user, @group)
|
||||
- if show_roles && should_user_see_group_roles?(current_user, @group)
|
||||
%span.pull-right
|
||||
%strong.member-access-level= member.human_access
|
||||
- if show_controls
|
||||
|
||||
Reference in New Issue
Block a user