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/runners.rb2
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