gitlab-org--gitlab-foss/app/services/ci/run_scheduled_build_service.rb
2018-10-02 17:04:04 +02:00

13 lines
275 B
Ruby

# frozen_string_literal: true
module Ci
class RunScheduledBuildService < ::BaseService
def execute(build)
unless can?(current_user, :update_build, build)
raise Gitlab::Access::AccessDeniedError
end
build.enqueue_scheduled!
end
end
end