Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-22 19:45:42 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-22 19:45:42 +0400
commit893ce9ae24ffce68152cc0370ad74005e0997cee (patch)
tree16bf9284c833534fe5efc6ca715aa976c5cdb96b
parentda854542673c9debd4ffa28f1113174e63004857 (diff)
Fix git over HTTP
-rw-r--r--lib/gitlab/backend/grack_auth.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index 05329baf0b1..766e3874555 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -53,6 +53,10 @@ module Grack
end
end
+ def can?(object, action, subject)
+ abilities.allowed?(object, action, subject)
+ end
+
def current_ref
if @env["HTTP_CONTENT_ENCODING"] =~ /gzip/
input = Zlib::GzipReader.new(@request.body).read
@@ -63,5 +67,15 @@ module Grack
@request.body.rewind
/refs\/heads\/([\w-]+)/.match(input).to_a.first
end
+
+ protected
+
+ def abilities
+ @abilities ||= begin
+ abilities = Six.new
+ abilities << Ability
+ abilities
+ end
+ end
end# Auth
end# Grack