Using Resque and Devise, i have roles for User, like:
User.first.role #=> admin
User.last.role #=> regular
I want to setup an authentication for Resque. So, inside config/routes.rb i have:
namespace :admin do
mount Resque::Server.new, :at => "/resque", :as => :resque
end
And, of course it's accessible for all logged in users.
Is there any way to use a role from User.role? It should be accessible only by users with 'admin' role.
Thanks a lot.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…