I have a namespace in my router like so:
namespace :my do
resources :addressbookitems
end
and in controllers/my/addressbookitems_controller.rb I have, for example, actions index and show.
I would like to limit resources accessible to my users differently based on the namespace: if they access /addressbookitems I would like to have different abilities then with /my/addressbookitems. How would i structure my Ability class?
With plain cancan I think the only option would be to override all behavior:
They show an example of this here: https://github.com/ryanb/cancan/wiki/Abilities-in-Database
The other option would be use the
cancan_namespacegem: https://github.com/galetahub/cancan_namespace