diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /app/finders/groups_finder.rb | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'app/finders/groups_finder.rb')
-rw-r--r-- | app/finders/groups_finder.rb | 32 |
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 |