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
Boxiang Sun
gitlab-ce
Commits
c98f89ea
Commit
c98f89ea
authored
Jun 22, 2016
by
Patricio Cano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify access checks
parent
8b14d1d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
app/controllers/projects/git_http_controller.rb
app/controllers/projects/git_http_controller.rb
+7
-1
No files found.
app/controllers/projects/git_http_controller.rb
View file @
c98f89ea
...
@@ -162,12 +162,18 @@ class Projects::GitHttpController < Projects::ApplicationController
...
@@ -162,12 +162,18 @@ class Projects::GitHttpController < Projects::ApplicationController
return
false
unless
Gitlab
.
config
.
gitlab_shell
.
upload_pack
return
false
unless
Gitlab
.
config
.
gitlab_shell
.
upload_pack
if
user
if
user
Gitlab
::
GitAccess
.
new
(
user
,
project
,
'http'
).
download_access_check
.
allowed?
access
.
allowed?
else
else
ci?
||
project
.
public?
ci?
||
project
.
public?
end
end
end
end
def
access
return
@access
if
defined?
(
@access
)
@access
=
Gitlab
::
GitAccess
.
new
(
user
,
project
,
'http'
).
check
(
'git-upload-pack'
)
end
def
receive_pack_allowed?
def
receive_pack_allowed?
return
false
unless
Gitlab
.
config
.
gitlab_shell
.
receive_pack
return
false
unless
Gitlab
.
config
.
gitlab_shell
.
receive_pack
...
...
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