ruby on rails 3 - Cancan with rails_admin -
class ability include cancan::ability def initialize(user) user ||= user.new if user , user.admin? can :access, :rails_admin can :dashboard if user.has_role? :superadmin can :manage, :all elsif user.has_role? :admin can :manage, [event] end end end even if specify can :manage, :all/can :access,:rails_admin can :dashboard , remove - still directs me home page access denied error. here application controller.
class applicationcontroller < actioncontroller::base rescue_from cancan::accessdenied |exception| redirect_to '/', notice: 'access denied' end end what's happening here?!
Comments
Post a Comment