2da45e9cbf
Renamed protect_resque.rb => resque_authentication Integrated resque web with the rest of gitlab
14 lines
No EOL
311 B
Ruby
14 lines
No EOL
311 B
Ruby
require 'resque/server'
|
|
class Authentication
|
|
def initialize(app)
|
|
@app = app
|
|
end
|
|
|
|
def call(env)
|
|
account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user)
|
|
raise "Access denied" if !account.admin?
|
|
@app.call(env)
|
|
end
|
|
end
|
|
|
|
Resque::Server.use Authentication |