summaryrefslogtreecommitdiff
path: root/app/controllers/groups/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/groups/application_controller.rb')
-rw-r--r--app/controllers/groups/application_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb
index a3bbfc8be0d..f6c71ac8087 100644
--- a/app/controllers/groups/application_controller.rb
+++ b/app/controllers/groups/application_controller.rb
@@ -13,8 +13,16 @@ class Groups::ApplicationController < ApplicationController
before_action :set_sorting
requires_cross_project_access
+ helper_method :can_manage_members?
+
private
+ def can_manage_members?(group = @group)
+ strong_memoize(:can_manage_members) do
+ can?(current_user, :admin_group_member, group)
+ end
+ end
+
def group
@group ||= find_routable!(Group, params[:group_id] || params[:id])
end