diff options
author | Robert Speicher <robert@gitlab.com> | 2016-03-02 15:05:54 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-03-02 15:05:54 +0000 |
commit | 84f158ebc81fe38d3aadc6a99edac13e2ad1ca0a (patch) | |
tree | 9553f6769d0510087e2fd61c4c6ca29bd8f36cef | |
parent | cb6af816707571317d8cdaf4a6df20db23512398 (diff) | |
parent | 9b9abb16549f6c450559d95bc27fb708c31690b6 (diff) | |
download | gitlab-ce-84f158ebc81fe38d3aadc6a99edac13e2ad1ca0a.tar.gz |
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
![Screen_Shot_2016-03-01_at_8.59.02_AM](/uploads/704ab3149f60c363dd8374bd0c06a46a/Screen_Shot_2016-03-01_at_8.59.02_AM.png)
## After
![Screen_Shot_2016-03-01_at_9.17.54_AM](/uploads/5fcabef352cbc41dade037767f90ace3/Screen_Shot_2016-03-01_at_9.17.54_AM.png)
See merge request !3044
-rw-r--r-- | app/views/groups/group_members/_group_member.html.haml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/groups/group_members/_group_member.html.haml b/app/views/groups/group_members/_group_member.html.haml index a79a0fcdc8e..60234be8f83 100644 --- a/app/views/groups/group_members/_group_member.html.haml +++ b/app/views/groups/group_members/_group_member.html.haml @@ -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 |