Merge pull request #1018 from glebm/master

Resque Authentication + iFrame view
This commit is contained in:
Dmitriy Zaporozhets 2012-06-29 04:53:43 -07:00
commit f73d71810e
7 changed files with 28 additions and 11 deletions

View file

@ -1,5 +0,0 @@
require 'resque/server'
Resque::Server.use(Rack::Auth::Basic) do |user, password|
user == "gitlab"
password == "5iveL!fe"
end

View file

@ -0,0 +1,14 @@
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