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
03b3d53d
Commit
03b3d53d
authored
Dec 18, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific code from LfsRequest
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
7bc624b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
app/controllers/concerns/lfs_request.rb
app/controllers/concerns/lfs_request.rb
+6
-1
ee/app/controllers/concerns/ee/lfs_request.rb
ee/app/controllers/concerns/ee/lfs_request.rb
+10
-5
No files found.
app/controllers/concerns/lfs_request.rb
View file @
03b3d53d
...
...
@@ -94,7 +94,7 @@ module LfsRequest
def
lfs_upload_access?
return
false
unless
project
.
lfs_enabled?
return
false
unless
has_authentication_ability?
(
:push_code
)
return
false
if
project
.
above_size_limit?
||
objects_exceed_repo_limit
?
return
false
if
limit_exceeded
?
lfs_deploy_token?
||
can?
(
user
,
:push_code
,
project
)
end
...
...
@@ -122,6 +122,11 @@ module LfsRequest
def
has_authentication_ability?
(
capability
)
(
authentication_abilities
||
[]).
include?
(
capability
)
end
# Overriden in EE
def
limit_exceeded?
false
end
end
LfsRequest
.
prepend
(
EE
::
LfsRequest
)
ee/app/controllers/concerns/ee/lfs_request.rb
View file @
03b3d53d
...
...
@@ -3,14 +3,19 @@
module
EE
module
LfsRequest
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
include
::
Gitlab
::
Utils
::
StrongMemoize
private
override
:lfs_forbidden!
def
lfs_forbidden!
if
project
.
above_size_limit?
||
objects_exceed_repo_limit?
render_size_error
else
super
end
limit_exceeded?
?
render_size_error
:
super
end
override
:limit_exceeded?
def
limit_exceeded?
project
.
above_size_limit?
||
objects_exceed_repo_limit?
end
def
render_size_error
...
...
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