Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bb822b40
Commit
bb822b40
authored
Jun 18, 2020
by
Maxime Orefice
Committed by
Shinya Maeda
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce Pipeline abstract controller
parent
875a6f91
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
app/controllers/projects/pipelines/application_controller.rb
app/controllers/projects/pipelines/application_controller.rb
+24
-0
No files found.
app/controllers/projects/pipelines/application_controller.rb
0 → 100644
View file @
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment