summaryrefslogtreecommitdiff
path: root/app/helpers/members_helper.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-17 10:34:37 +0200
committerRémy Coutable <remy@rymai.me>2016-06-17 13:03:19 +0200
commite71ce77e39837f3e18403ceb07d27a0497b7196c (patch)
treedff1628a9b8d507fc93507b33747da9901358a85 /app/helpers/members_helper.rb
parentb2dc9176018729efc1969035b30017c2ed81a708 (diff)
downloadgitlab-ce-e71ce77e39837f3e18403ceb07d27a0497b7196c.tar.gz
Ensure group/project owners can see their members' access_level
When you are the last owner of a group or the owner of a project, you don't have the :update_<source>_member / :destroy_<source>_member abilities, but you do have the :admin_<source>_member so you should be able to see your members access levels. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/helpers/members_helper.rb')
-rw-r--r--app/helpers/members_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb
index 877c77050be..3897cfa2e10 100644
--- a/app/helpers/members_helper.rb
+++ b/app/helpers/members_helper.rb
@@ -6,6 +6,12 @@ module MembersHelper
"#{action}_#{member.type.underscore}".to_sym
end
+ def default_show_roles(member)
+ can?(current_user, action_member_permission(:update, member), member) ||
+ can?(current_user, action_member_permission(:destroy, member), member) ||
+ can?(current_user, action_member_permission(:admin, member), member.source)
+ end
+
def remove_member_message(member, user: nil)
user = current_user if defined?(current_user)