debian-mirror-gitlab/app/finders/groups/accepting_project_imports_finder.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
633 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# frozen_string_literal: true
module Groups
class AcceptingProjectImportsFinder
def initialize(current_user)
@current_user = current_user
end
def execute
::Group.from_union(
[
current_user.manageable_groups,
managable_groups_originating_from_group_shares
]
)
end
private
attr_reader :current_user
def managable_groups_originating_from_group_shares
GroupGroupLink
.with_owner_or_maintainer_access
.groups_accessible_via(
current_user.owned_or_maintainers_groups
.select(:id)
)
end
end
end