Clear questions and runnable code
get the best and fastest answer
Passing Data Back From Mason templateby water (Chaplain)
|on Jun 02, 2006 at 01:08 UTC||Need Help??|
water has asked for the
wisdom of the Perl Monks concerning the following question:
Playing with Catalyst, using Mason for the view.
Working on access control: certain pages can only be accessed by users in certain roles.
My question: where to store the roles for a given page?
One method is to have the controller for each page check, storing the valid roles for each page there in the corresponding method.
A different way (perhaps) which seems more natural to me would be to store the list of eligble roles for each page on the template for that page itself.
What do folks think about this design?
And how can a list defined on a mason template be accessed by the app (eg a catalyst method) that populates said template?
Thanks for advice suggestions etc!