Commit 893ce9ae24ffce68152cc0370ad74005e0997cee
1 parent
da854542
Exists in
master
and in
4 other branches
Fix git over HTTP
Showing
1 changed file
with
14 additions
and
0 deletions
Show diff stats
lib/gitlab/backend/grack_auth.rb
... | ... | @@ -53,6 +53,10 @@ module Grack |
53 | 53 | end |
54 | 54 | end |
55 | 55 | |
56 | + def can?(object, action, subject) | |
57 | + abilities.allowed?(object, action, subject) | |
58 | + end | |
59 | + | |
56 | 60 | def current_ref |
57 | 61 | if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/ |
58 | 62 | input = Zlib::GzipReader.new(@request.body).read |
... | ... | @@ -63,5 +67,15 @@ module Grack |
63 | 67 | @request.body.rewind |
64 | 68 | /refs\/heads\/([\w-]+)/.match(input).to_a.first |
65 | 69 | end |
70 | + | |
71 | + protected | |
72 | + | |
73 | + def abilities | |
74 | + @abilities ||= begin | |
75 | + abilities = Six.new | |
76 | + abilities << Ability | |
77 | + abilities | |
78 | + end | |
79 | + end | |
66 | 80 | end# Auth |
67 | 81 | end# Grack | ... | ... |