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,6 +53,10 @@ module Grack | ||
| 53 | end | 53 | end |
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | + def can?(object, action, subject) | ||
| 57 | + abilities.allowed?(object, action, subject) | ||
| 58 | + end | ||
| 59 | + | ||
| 56 | def current_ref | 60 | def current_ref |
| 57 | if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/ | 61 | if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/ |
| 58 | input = Zlib::GzipReader.new(@request.body).read | 62 | input = Zlib::GzipReader.new(@request.body).read |
| @@ -63,5 +67,15 @@ module Grack | @@ -63,5 +67,15 @@ module Grack | ||
| 63 | @request.body.rewind | 67 | @request.body.rewind |
| 64 | /refs\/heads\/([\w-]+)/.match(input).to_a.first | 68 | /refs\/heads\/([\w-]+)/.match(input).to_a.first |
| 65 | end | 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 | end# Auth | 80 | end# Auth |
| 67 | end# Grack | 81 | end# Grack |