summaryrefslogtreecommitdiff
path: root/app/finders/groups
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 15:40:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 15:40:28 +0000
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /app/finders/groups
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
downloadgitlab-ce-b595cb0c1dec83de5bdee18284abe86614bed33b.tar.gz
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'app/finders/groups')
-rw-r--r--app/finders/groups/user_groups_finder.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/finders/groups/user_groups_finder.rb b/app/finders/groups/user_groups_finder.rb
index f4aed413867..90367638dcf 100644
--- a/app/finders/groups/user_groups_finder.rb
+++ b/app/finders/groups/user_groups_finder.rb
@@ -35,7 +35,7 @@ module Groups
attr_reader :current_user, :target_user, :params
def sort(items)
- items.order(path: :asc, id: :asc) # rubocop: disable CodeReuse/ActiveRecord
+ items.order(Group.arel_table[:path].asc, Group.arel_table[:id].asc) # rubocop: disable CodeReuse/ActiveRecord
end
def by_search(items)
@@ -47,6 +47,8 @@ module Groups
def by_permission_scope
if permission_scope_create_projects?
target_user.manageable_groups(include_groups_with_developer_maintainer_access: true)
+ elsif permission_scope_transfer_projects?
+ target_user.manageable_groups(include_groups_with_developer_maintainer_access: false)
else
target_user.groups
end
@@ -55,5 +57,9 @@ module Groups
def permission_scope_create_projects?
params[:permission_scope] == :create_projects
end
+
+ def permission_scope_transfer_projects?
+ params[:permission_scope] == :transfer_projects
+ end
end
end