Merge branch 'master' into rails-4.1.9

This commit is contained in:
Alexander Machehin 2015-03-11 16:23:40 +05:00
commit b5592fd695
1 changed files with 5 additions and 4 deletions

View File

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