2021-09-30 23:02:18 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Members
|
|
|
|
module Groups
|
|
|
|
class CreatorService < Members::CreatorService
|
2022-07-23 23:45:48 +05:30
|
|
|
class << self
|
|
|
|
def cannot_manage_owners?(source, current_user)
|
|
|
|
source.max_member_access_for_user(current_user) < Gitlab::Access::OWNER
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-09-30 23:02:18 +05:30
|
|
|
private
|
|
|
|
|
2022-06-21 17:19:12 +05:30
|
|
|
def can_create_new_member?
|
|
|
|
current_user.can?(:admin_group_member, member.group)
|
|
|
|
end
|
|
|
|
|
|
|
|
def can_update_existing_member?
|
|
|
|
current_user.can?(:update_group_member, member)
|
2021-09-30 23:02:18 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|