Commit 546d11f4 authored by Mario de la Ossa's avatar Mario de la Ossa

Extract EE-specific code from app/controllers/groups/group_members_controller.rb

parent fd8d9777
......@@ -5,13 +5,12 @@ class Groups::GroupMembersController < Groups::ApplicationController
include MembersPresentation
include SortingHelper
# Authorize
before_action :authorize_admin_group_member!, except: [:index, :leave, :request_access, :update, :override]
before_action :authorize_update_group_member!, only: [:update, :override]
def self.admin_not_required_endpoints
%i[index leave request_access]
end
skip_cross_project_access_check :index, :create, :update, :destroy, :request_access,
:approve_access_request, :leave, :resend_invite,
:override
# Authorize
before_action :authorize_admin_group_member!, except: admin_not_required_endpoints
skip_cross_project_access_check :index, :create, :update, :destroy, :request_access,
:approve_access_request, :leave, :resend_invite,
......
......@@ -3,6 +3,19 @@ module EE
module GroupMembersController
extend ActiveSupport::Concern
class_methods do
extend ::Gitlab::Utils::Override
override :admin_not_required_endpoints
def admin_not_required_endpoints
super.concat(%i[update override])
end
end
included do
before_action :authorize_update_group_member!, only: [:update, :override]
end
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def override
member = @group.members.find_by!(id: params[:id])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment