Commit 8e7230fd99bc4e29abddf966da33d8458ef9fd1a

Authored by Dmitriy Zaporozhets
2 parents d1564370 4bc64b55

Merge branch 'master' into stable

  1 +v 3.0.1
  2 + - Fixed git over http
  3 +
1 v 3.0.0 4 v 3.0.0
2 - Projects groups 5 - Projects groups
3 - Web Editor 6 - Web Editor
1 -3.0.0 1 +3.0.1
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