gitlab-org--gitlab-foss/app/serializers/runner_entity.rb
2017-05-31 21:56:18 +02:00

18 lines
385 B
Ruby

class RunnerEntity < Grape::Entity
include RequestAwareEntity
expose :id, :description
expose :edit_path,
if: -> (*) { can?(request.current_user, :admin_build, project) && runner.specific? } do |runner|
edit_namespace_project_runner_path(project.namespace, project, runner)
end
private
alias_method :runner, :object
def project
request.project
end
end