Commit 15efe30e authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'mo-introduce-pipeline-abstract-controller' into 'master'

Introduce Pipeline abstract controller

See merge request gitlab-org/gitlab!34410
parents 5d0a3d83 bb822b40
# frozen_string_literal: true
# Abstract class encapsulating common logic for creating new controllers in a pipeline context
module Projects
module Pipelines
class ApplicationController < Projects::ApplicationController
include Gitlab::Utils::StrongMemoize
before_action :pipeline
before_action :authorize_read_pipeline!
private
def pipeline
strong_memoize(:pipeline) do
project.all_pipelines.find(params[:pipeline_id]).tap do |pipeline|
render_404 unless can?(current_user, :read_pipeline, pipeline)
end
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment