Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb1
-rw-r--r--lib/api/users.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 899d68bc6c7..1dd191161ef 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -32,6 +32,7 @@ module API
expose :can_create_project?, as: :can_create_project
expose :two_factor_enabled?, as: :two_factor_enabled
expose :external
+ expose :private_token, if: lambda { |user, options| user.is_admin? && options[:sudo_identifier] }
end
class UserLogin < UserFull
diff --git a/lib/api/users.rb b/lib/api/users.rb
index bc2362aa72e..b3870e0c7c8 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -353,7 +353,7 @@ module API
success Entities::UserFull
end
get do
- present current_user, with: Entities::UserFull
+ present current_user, with: Entities::UserFull, sudo_identifier: sudo_identifier
end
desc "Get the currently authenticated user's SSH keys" do