Commit bb822b40 authored by Maxime Orefice's avatar Maxime Orefice Committed by Shinya Maeda

Introduce Pipeline abstract controller

parent 875a6f91
# 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