fix error with grack
This commit is contained in:
parent
c72fd6f4e8
commit
5b0d149275
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue