ruby on rails - how to restrict active admin to admin users only? -


i have user model rolify gem. in app using active_admin admin interface. have can restrict active_admin admin users only?

try putting rolify role check in same place mentioned in active admin documentation's example getting access current user:

class onlyadmins < activeadmin::authorizationadapter   def authorized?(action, subject = nil)     # rolify check here     user.has_role? :admin   end end 

Comments

Popular posts from this blog

arrays - PHP Shopping Cart Variable and Object errors -

mysql - java.sql.SQLException Parameter index out of range (1 > number of parameters, which is 0) -