From 5a73318262aab6ab952f2b7205b3674ea1f20053 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 6 Dec 2022 18:08:22 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/api/helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 75e7612bd5b..86763b2cd67 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -301,7 +301,7 @@ module API def authenticated_as_admin! authenticate! - forbidden! unless current_user.admin? + forbidden! unless current_user.can_admin_all_resources? end def authorize!(action, subject = :global, reason = nil) @@ -710,7 +710,7 @@ module API unauthorized! unless initial_current_user - unless initial_current_user.admin? + unless initial_current_user.can_admin_all_resources? forbidden!('Must be admin to use sudo') end -- cgit v1.2.3