summaryrefslogtreecommitdiff
path: root/lib/gitlab/lfs_token.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-11-08 16:21:39 +0000
committerRémy Coutable <remy@rymai.me>2017-11-08 16:21:39 +0000
commit0232450c8aee08a656275caf7b990e0bcbbb1cf4 (patch)
tree9817869e4ed30b9ab05480c8b3daa6776148e557 /lib/gitlab/lfs_token.rb
parent9e294180f29ec7ec9e9734a65b2b5d3124d657e4 (diff)
downloadgitlab-ce-0232450c8aee08a656275caf7b990e0bcbbb1cf4.tar.gz
Fix Error 500 when pushing LFS objects with a write deploy key
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r--lib/gitlab/lfs_token.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/lfs_token.rb b/lib/gitlab/lfs_token.rb
index 8e57ba831c5..ead5d566871 100644
--- a/lib/gitlab/lfs_token.rb
+++ b/lib/gitlab/lfs_token.rb
@@ -27,6 +27,10 @@ module Gitlab
end
end
+ def deploy_key_pushable?(project)
+ actor.is_a?(DeployKey) && actor.can_push_to?(project)
+ end
+
def user?
actor.is_a?(User)
end