I create an admin page by using activeadmin gem http://activeadmin.info/ I use cancan to authorize the privilege for 2 kind of user, user manage and book manage user.
My question is: How I hide the resource User when a book manage user log in to admin page?
I tried something like that but it didn't work
menu false if can? :manage, BookHeader
or
menu false if authorize! :manage, BookHeader
Thanks for your help!
You have to use proc for build menu dynamicly
Examples
dynamic label
menu :label => proc{current_admin_user.admin? ? "Accounts" : "My Account"}
Display/Hide
menu :if => proc{ can?(:manage, BookHeader ) }
For more info about integrating AA and CanCan read this article
https://github.com/gregbell/active_admin/wiki/How-to-work-with-cancan