diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/finders/users_finder.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/finders/users_finder.rb')
-rw-r--r-- | app/finders/users_finder.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/finders/users_finder.rb b/app/finders/users_finder.rb index cc94536bf79..42042406f3f 100644 --- a/app/finders/users_finder.rb +++ b/app/finders/users_finder.rb @@ -34,6 +34,7 @@ class UsersFinder users = User.all.order_id_desc users = by_username(users) users = by_id(users) + users = by_admins(users) users = by_search(users) users = by_blocked(users) users = by_active(users) @@ -62,6 +63,12 @@ class UsersFinder users.id_in(params[:id]) end + def by_admins(users) + return users unless params[:admins] && current_user&.can_read_all_resources? + + users.admins + end + def by_search(users) return users unless params[:search].present? |