I'm utilizing roles within AdminUsers inside Active Admin and am using CanCan to define access across different resources.
It's working well with regards to limiiting access, but I'm running into trouble hiding menus based on role.
According to the ActiveAdmin docs, the following should work:
menu :if => proc{ can?(:manage, AdminUser) }
In my ability.rb model file, I have
case user.role
when "admin"
can :manage, :all
cannot :manage, Company
when "manager"
can :manage, Program
can :manage, Client
I even added cannot :manage, AdminUser under manager as well in order to explicitly state it.
I'm trying to hide AdminUser menu when logged in as a "manager" role. Currently, it's still showing it to that user though if I click it, it correctly tells me that I'm not authorized.