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
Post a Comment