From b35d16a77f6a63db756a94eeff3788e819e7ed04 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 11 May 2018 10:10:22 +0200 Subject: Allow admin to assign shared runner to project through API --- lib/api/runners.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api') diff --git a/lib/api/runners.rb b/lib/api/runners.rb index c6dc40ae789..0fb125a6944 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -203,11 +203,11 @@ module API end def authenticate_enable_runner!(runner) - forbidden!("Runner is shared") if runner.is_shared? - forbidden!("Runner is locked") if runner.locked? forbidden!("Runner is a group runner") if runner.group_type? + return if current_user.admin? + forbidden!("Runner is locked") if runner.locked? forbidden!("No access granted") unless can?(current_user, :assign_runner, runner) end -- cgit v1.2.1