diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-12-03 14:59:10 +0100 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-12-03 14:59:10 +0100 |
commit | 0a081e7eff9730beebd4bea1eb40873d907b6293 (patch) | |
tree | 22a08d359a27cd13ddf34247fa1cb95642ec1af9 /app/models/lfs_object.rb | |
parent | 6689224a90f3d2500be5d927ea1ed9656fc7b1b6 (diff) | |
download | gitlab-ce-0a081e7eff9730beebd4bea1eb40873d907b6293.tar.gz |
If a user clicks on the LFS object, it should be served if the user has access to the object.
Diffstat (limited to 'app/models/lfs_object.rb')
-rw-r--r-- | app/models/lfs_object.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb index 3c1426f59d0..f087d07b5b2 100644 --- a/app/models/lfs_object.rb +++ b/app/models/lfs_object.rb @@ -5,4 +5,14 @@ class LfsObject < ActiveRecord::Base validates :oid, presence: true, uniqueness: true mount_uploader :file, LfsObjectUploader + + MATCH_FROM_POINTER_REGEX = "(?<=sha256:)([0-9a-f]{64})" + + def storage_project(project) + if project && project.forked? + project.forked_from_project + else + project + end + end end |