BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d035d735
Commit
d035d735
authored
Jul 19, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests and fine tweak permission error message
parent
a397a0eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+5
-5
user_access.rb
lib/gitlab/user_access.rb
+4
-2
No files found.
app/services/ci/create_pipeline_service.rb
View file @
d035d735
...
...
@@ -23,16 +23,16 @@ module Ci
unless
allowed_to_trigger_pipeline?
(
triggering_user
)
if
can?
(
triggering_user
,
:create_pipeline
,
project
)
return
error
(
"Insufficient permissions for protected ref '
#{
ref
}
'"
)
if
branch?
||
tag?
return
error
(
"Insufficient permissions for protected ref '
#{
ref
}
'"
)
else
return
error
(
'Reference not found'
)
end
else
return
error
(
'Insufficient permissions to create a new pipeline'
)
end
end
unless
branch?
||
tag?
return
error
(
'Reference not found'
)
end
unless
commit
return
error
(
'Commit not found'
)
end
...
...
lib/gitlab/user_access.rb
View file @
d035d735
...
...
@@ -94,13 +94,15 @@ module Gitlab
def
protected_branch_accessible_to?
(
ref
,
action
:)
ProtectedBranch
.
protected_ref_accessible_to?
(
ref
,
user
,
action:
action
,
ref
,
user
,
action:
action
,
protected_refs:
project
.
protected_branches
)
end
def
protected_tag_accessible_to?
(
ref
,
action
:)
ProtectedTag
.
protected_ref_accessible_to?
(
ref
,
user
,
action:
action
,
ref
,
user
,
action:
action
,
protected_refs:
project
.
protected_tags
)
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