Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (15 sloc) 0.273 kb
class AdminRack
def initialize(app)
@app = app
end
def call(env)
user = env['warden'].authenticate(:scope => :user)
if user && user.admin?
@app.call(env)
else
[307, {"Location" => '/'}, self]
end
end
def each(&block)
end
end
Jump to Line
Something went wrong with that request. Please try again.