Created
August 26, 2013 10:59
-
-
Save timrwilliams/6340307 to your computer and use it in GitHub Desktop.
How to secure access to Resque admin page in Rails 3.2 by only allowing users with a specified role to access the /resque route. Non authorized users will receive 404 error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes you have a role attribue on user model | |
authenticate :user, lambda {|u| u.role == 'super_admin' } do | |
mount Resque::Server.new, :at => "/resque" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment