diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-05 18:08:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-05 18:08:48 +0300 |
commit | 205b6baf2677879c35968d2b659225b58e8a1227 (patch) | |
tree | 10ed06185aae2f6ed6e7c61349a92acab605daca /app/finders | |
parent | f34077e88198da754b4efecd1ce1d996ce982286 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/groups/user_groups_finder.rb | 8 |
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 |