diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-02-04 10:33:29 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-02-19 13:18:47 +0100 |
commit | 553bac57d01f103f3f419e8096f30f422781adce (patch) | |
tree | badb3f03a25d930ac2bacd268107b951880de3f3 /lib | |
parent | dc32af950821946f5bc3a4e57b4b7eeb0ffb032f (diff) | |
download | gitlab-ce-553bac57d01f103f3f419e8096f30f422781adce.tar.gz |
Add token to runner details output in API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 1 | ||||
-rw-r--r-- | lib/api/runners.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 0170fa5a654..af030159580 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -387,6 +387,7 @@ module API expose :tag_list expose :version, :revision, :platform, :architecture expose :contacted_at, as: :last_contact + expose :token, if: lambda { |runner, options| options[:user_is_admin] || !runner.is_shared? } expose :projects, with: Entities::RunnerProjectDetails end diff --git a/lib/api/runners.rb b/lib/api/runners.rb index 284909c8db4..15782474369 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -33,7 +33,7 @@ module API runner = get_runner(params[:id]) can_show_runner?(runner) unless current_user.is_admin? - present runner, with: Entities::RunnerDetails + present runner, with: Entities::RunnerDetails, user_is_admin: current_user.is_admin? end # Update runner's details |