diff options
Diffstat (limited to 'app/services/groups')
-rw-r--r-- | app/services/groups/group_links/create_service.rb | 2 | ||||
-rw-r--r-- | app/services/groups/group_links/destroy_service.rb | 2 | ||||
-rw-r--r-- | app/services/groups/group_links/update_service.rb | 2 | ||||
-rw-r--r-- | app/services/groups/transfer_service.rb | 5 |
4 files changed, 8 insertions, 3 deletions
diff --git a/app/services/groups/group_links/create_service.rb b/app/services/groups/group_links/create_service.rb index 5f81e5972b0..8c3ba0a63f2 100644 --- a/app/services/groups/group_links/create_service.rb +++ b/app/services/groups/group_links/create_service.rb @@ -24,7 +24,7 @@ module Groups ) if link.save - shared_with_group.refresh_members_authorized_projects(direct_members_only: true) + shared_with_group.refresh_members_authorized_projects(blocking: false, direct_members_only: true) success(link: link) else error(link.errors.full_messages.to_sentence, 409) diff --git a/app/services/groups/group_links/destroy_service.rb b/app/services/groups/group_links/destroy_service.rb index 05504a80f46..0e7fd7e0817 100644 --- a/app/services/groups/group_links/destroy_service.rb +++ b/app/services/groups/group_links/destroy_service.rb @@ -16,7 +16,7 @@ module Groups groups_to_refresh = links.map(&:shared_with_group) groups_to_refresh.uniq.each do |group| - group.refresh_members_authorized_projects(direct_members_only: true) + group.refresh_members_authorized_projects(blocking: false, direct_members_only: true) end else Gitlab::AppLogger.info( diff --git a/app/services/groups/group_links/update_service.rb b/app/services/groups/group_links/update_service.rb index 3703d535482..a1411de36d6 100644 --- a/app/services/groups/group_links/update_service.rb +++ b/app/services/groups/group_links/update_service.rb @@ -13,7 +13,7 @@ module Groups group_link.update!(group_link_params) if requires_authorization_refresh?(group_link_params) - group_link.shared_with_group.refresh_members_authorized_projects(direct_members_only: true) + group_link.shared_with_group.refresh_members_authorized_projects(blocking: false, direct_members_only: true) end end diff --git a/app/services/groups/transfer_service.rb b/app/services/groups/transfer_service.rb index 518d061c654..966d04ceb70 100644 --- a/app/services/groups/transfer_service.rb +++ b/app/services/groups/transfer_service.rb @@ -46,6 +46,7 @@ module Groups def ensure_allowed_transfer raise_transfer_error(:group_is_already_root) if group_is_already_root? raise_transfer_error(:same_parent_as_current) if same_parent? + raise_transfer_error(:has_subscription) if has_subscription? raise_transfer_error(:invalid_policies) unless valid_policies? raise_transfer_error(:namespace_with_same_path) if namespace_with_same_path? raise_transfer_error(:group_contains_images) if group_projects_contain_registry_images? @@ -73,6 +74,10 @@ module Groups @new_parent_group && @new_parent_group.id == @group.parent_id end + def has_subscription? + @group.paid? + end + def transfer_to_subgroup? @new_parent_group && \ @group.self_and_descendants.pluck_primary_key.include?(@new_parent_group.id) |