diff options
author | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-11-21 12:59:37 +0000 |
---|---|---|
committer | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-12-07 14:42:51 +0000 |
commit | 3ed96afc47c481db4f8c0a6581602abaee920808 (patch) | |
tree | 9f840b076417839018586c99d0555fefd4b714cd /lib/api/entities.rb | |
parent | 8b379465a5be48c8062379a3dea8e58110c52d87 (diff) | |
download | gitlab-ce-3ed96afc47c481db4f8c0a6581602abaee920808.tar.gz |
adds impersonator variable and makes sudo usage overall more clear24537-reenable-private-token-with-sudo
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 1dd191161ef..006d5f9f44e 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -22,7 +22,7 @@ module API expose :provider, :extern_uid end - class UserFull < User + class UserPublic < User expose :last_sign_in_at expose :confirmed_at expose :email @@ -32,10 +32,9 @@ 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 + class UserWithPrivateToken < UserPublic expose :private_token end @@ -290,7 +289,7 @@ module API end class SSHKeyWithUser < SSHKey - expose :user, using: Entities::UserFull + expose :user, using: Entities::UserPublic end class Note < Grape::Entity |