Skip to content

Instantly share code, notes, and snippets.

@timrwilliams
Created August 26, 2013 10:59
Show Gist options
  • Save timrwilliams/6340307 to your computer and use it in GitHub Desktop.
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.
# 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