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 ...@@ -5,13 +5,12 @@ class Groups::GroupMembersController < Groups::ApplicationController
include MembersPresentation include MembersPresentation
include SortingHelper include SortingHelper
# Authorize def self.admin_not_required_endpoints
before_action :authorize_admin_group_member!, except: [:index, :leave, :request_access, :update, :override] %i[index leave request_access]
before_action :authorize_update_group_member!, only: [:update, :override] end
skip_cross_project_access_check :index, :create, :update, :destroy, :request_access, # Authorize
:approve_access_request, :leave, :resend_invite, before_action :authorize_admin_group_member!, except: admin_not_required_endpoints
:override
skip_cross_project_access_check :index, :create, :update, :destroy, :request_access, skip_cross_project_access_check :index, :create, :update, :destroy, :request_access,
:approve_access_request, :leave, :resend_invite, :approve_access_request, :leave, :resend_invite,
......
...@@ -3,6 +3,19 @@ module EE ...@@ -3,6 +3,19 @@ module EE
module GroupMembersController module GroupMembersController
extend ActiveSupport::Concern 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 # rubocop:disable Gitlab/ModuleWithInstanceVariables
def override def override
member = @group.members.find_by!(id: params[:id]) 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