2020-09-28 11:09:44 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module InviteMembersHelper
|
2020-10-14 14:08:47 -04:00
|
|
|
include Gitlab::Utils::StrongMemoize
|
|
|
|
|
2020-09-28 11:09:44 -04:00
|
|
|
def invite_members_allowed?(group)
|
|
|
|
Feature.enabled?(:invite_members_group_modal, group) && can?(current_user, :admin_group_member, group)
|
|
|
|
end
|
2020-10-14 14:08:47 -04:00
|
|
|
|
|
|
|
def directly_invite_members?
|
|
|
|
strong_memoize(:directly_invite_members) do
|
|
|
|
experiment_enabled?(:invite_members_version_a) && can_import_members?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def indirectly_invite_members?
|
|
|
|
strong_memoize(:indirectly_invite_members) do
|
|
|
|
experiment_enabled?(:invite_members_version_b) && !can_import_members?
|
|
|
|
end
|
|
|
|
end
|
2020-10-26 11:08:40 -04:00
|
|
|
|
|
|
|
def invite_group_members?(group)
|
|
|
|
experiment_enabled?(:invite_members_empty_group_version_a) && Ability.allowed?(current_user, :admin_group_member, group)
|
|
|
|
end
|
2020-09-28 11:09:44 -04:00
|
|
|
end
|