diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/finders/users_finder.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/finders/users_finder.rb')
-rw-r--r-- | app/finders/users_finder.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/finders/users_finder.rb b/app/finders/users_finder.rb index 9c2462b42a6..11e3c341c1f 100644 --- a/app/finders/users_finder.rb +++ b/app/finders/users_finder.rb @@ -55,7 +55,7 @@ class UsersFinder private def base_scope - scope = current_user&.admin? ? User.all : User.without_forbidden_states + scope = current_user&.can_admin_all_resources? ? User.all : User.without_forbidden_states scope.order_id_desc end @@ -80,7 +80,7 @@ class UsersFinder def by_search(users) return users unless params[:search].present? - users.search(params[:search], with_private_emails: current_user&.admin?) + users.search(params[:search], with_private_emails: current_user&.can_admin_all_resources?) end def by_blocked(users) @@ -97,7 +97,7 @@ class UsersFinder # rubocop: disable CodeReuse/ActiveRecord def by_external_identity(users) - return users unless current_user&.admin? && params[:extern_uid] && params[:provider] + return users unless current_user&.can_admin_all_resources? && params[:extern_uid] && params[:provider] users.joins(:identities).merge(Identity.with_extern_uid(params[:provider], params[:extern_uid])) end |