Commit 8b379465 authored by tiagonbotelho's avatar tiagonbotelho

Reenables /user API request to return private-token if user is admin and requested with sudo

parent e09c6df0
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment