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
90f0145e
Commit
90f0145e
authored
Sep 08, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments containing the error msg for clarity
parent
eb970f8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
lib/gitlab/checks/change_access.rb
lib/gitlab/checks/change_access.rb
+1
-0
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+3
-0
No files found.
lib/gitlab/checks/change_access.rb
View file @
90f0145e
...
...
@@ -50,6 +50,7 @@ module Gitlab
def
push_checks
unless
can_push?
# You are not allowed to push code to this project.
raise
GitAccess
::
UnauthorizedError
,
ERROR_MESSAGES
[
:push_code
]
end
end
...
...
lib/gitlab/git_access.rb
View file @
90f0145e
...
...
@@ -236,11 +236,13 @@ module Gitlab
# TODO: please clean this up
def
check_push_access!
if
project
.
repository_read_only?
# The repository is temporarily read-only. Please try again later.
raise
UnauthorizedError
,
ERROR_MESSAGES
[
:read_only
]
end
if
deploy_key?
unless
deploy_key
.
can_push_to?
(
project
)
# This deploy key does not have write access to this project.
raise
UnauthorizedError
,
ERROR_MESSAGES
[
:deploy_key_upload
]
end
elsif
user
...
...
@@ -248,6 +250,7 @@ module Gitlab
elsif
authed_via_jwt?
# Authenticated via JWT
else
# You are not allowed to upload code for this project.
raise
UnauthorizedError
,
ERROR_MESSAGES
[
:upload
]
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