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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
9151ca7b
Commit
9151ca7b
authored
Sep 06, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor Ci::CreatePipelineService#allowed_to_create?
parent
2a54cbca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+9
-9
No files found.
app/services/ci/create_pipeline_service.rb
View file @
9151ca7b
...
@@ -96,16 +96,16 @@ module Ci
...
@@ -96,16 +96,16 @@ module Ci
end
end
def
allowed_to_create?
def
allowed_to_create?
access
=
Gitlab
::
UserAccess
.
new
(
current_user
,
project:
project
)
return
unless
can?
(
current_user
,
:create_pipeline
,
project
)
can?
(
current_user
,
:create_pipeline
,
project
)
&&
access
=
Gitlab
::
UserAccess
.
new
(
current_user
,
project:
project
)
if
branch?
if
branch?
access
.
can_update_branch?
(
ref
)
access
.
can_update_branch?
(
ref
)
elsif
tag?
elsif
tag?
access
.
can_create_tag?
(
ref
)
access
.
can_create_tag?
(
ref
)
else
else
true
# Allow it for now and we'll reject when we check ref existence
true
# Allow it for now and we'll reject when we check ref existence
end
end
end
end
def
update_merge_requests_head_pipeline
def
update_merge_requests_head_pipeline
...
...
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