fix error with grack

This commit is contained in:
Alexander Machehin 2015-03-11 15:53:41 +05:00
parent c72fd6f4e8
commit 5b0d149275
1 changed files with 3 additions and 3 deletions

View File

@ -11,9 +11,9 @@ module Grack
return render_not_found if project.blank? return render_not_found if project.blank?
return ::Rack::Auth::Basic.new(@app) do |u, p| return ::Rack::Auth::Basic.new(@app) do |u, p|
user = User.auth_by_token_or_login_pass(u, p) && user = User.auth_by_token_or_login_pass(u, p) and
ability = ::Ability.new(user) && ability.can?(action, project) && ability = ::Ability.new(user) and ability.can?(action, project) and
ENV['GL_ID'] = "user-#{user.id}" && ENV['GL_ID'] = "user-#{user.id}" and
ENV['GL_REPO_PATH'] = project.path ENV['GL_REPO_PATH'] = project.path
end.call(env) unless project.public? && read? # need auth end.call(env) unless project.public? && read? # need auth
end end