Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/groups_finder.rb')
-rw-r--r--app/finders/groups_finder.rb32
1 files changed, 8 insertions, 24 deletions
diff --git a/app/finders/groups_finder.rb b/app/finders/groups_finder.rb
index 24003111f88..63f7616884f 100644
--- a/app/finders/groups_finder.rb
+++ b/app/finders/groups_finder.rb
@@ -72,17 +72,10 @@ class GroupsFinder < UnionFinder
# rubocop: disable CodeReuse/ActiveRecord
def groups_with_min_access_level
- groups = current_user
+ current_user
.groups
.where('members.access_level >= ?', params[:min_access_level])
-
- if Feature.enabled?(:use_traversal_ids_groups_finder, current_user)
- groups.self_and_descendants
- else
- Gitlab::ObjectHierarchy
- .new(groups)
- .base_and_descendants
- end
+ .self_and_descendants
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -110,13 +103,11 @@ class GroupsFinder < UnionFinder
end
# rubocop: enable CodeReuse/ActiveRecord
- # rubocop: disable CodeReuse/ActiveRecord
def by_search(groups)
return groups unless params[:search].present?
groups.search(params[:search], include_parents: params[:parent].blank?)
end
- # rubocop: enable CodeReuse/ActiveRecord
def owned_groups
current_user&.owned_groups || Group.none
@@ -145,20 +136,13 @@ class GroupsFinder < UnionFinder
def get_groups_for_user
groups = []
- if Feature.enabled?(:use_traversal_ids_groups_finder, current_user)
- groups << if include_ancestors?
- current_user.authorized_groups.self_and_ancestors
- else
- current_user.authorized_groups
- end
+ groups << if include_ancestors?
+ current_user.authorized_groups.self_and_ancestors
+ else
+ current_user.authorized_groups
+ end
- groups << current_user.groups.self_and_descendants
- elsif include_ancestors?
- groups << Gitlab::ObjectHierarchy.new(groups_for_ancestors, groups_for_descendants).all_objects
- else
- groups << current_user.authorized_groups
- groups << Gitlab::ObjectHierarchy.new(groups_for_descendants).base_and_descendants
- end
+ groups << current_user.groups.self_and_descendants
groups
end