[Catalyst] Checking if I can visit a URL

Ton Voon tonvoon at gmail.com
Fri Dec 24 14:08:12 GMT 2010


I'm using Catalyst::ActionRole::ACL successfully - thanks for a great  
addition to Catalyst.

In my templates, I'd like to check if I can get to a specific action  
because I only want to show links where you can go to.

At the moment, I am using the equivalent role information (eg, $c- 
 >user->can_access_role("VIEW")), but this means I am not DRY because  
the /objects is already blocked with VIEW role. Is there a way I can  
say $c->can_visit("/objects") instead?

Looking in Catalyst::ActionRole::ACL there is a can_visit method, but  
I don't understand how I can invoke that from my own code.

Is this possible?


More information about the Catalyst mailing list