Perrin Harkins wrote:

On Mon, 2005-01-03 at 16:55 -0500, Arshavir Grigorian wrote:


I thought about that, but it would mean passing this data to every page, then code every page to relay it to the toolbar library template on each include.



The stash contents should be passed to all templates that you call
already. That's the default behavior.


I am not sure what you mean. Could you please explain this a little more?

In my understanding the 2 options are:

1) compute the permissions before every $tt->process call then pass it to the template in addition to all the data relevant to the template itself.

2) just call $tt->process() on each template and pass data only relevant to the template and let toolbar retrieve the permissions and display itself as needed.

Am I missing something?

I could see this strategy being a problem if you rarely use this data
and it takes a long time to compute, but otherwise it seems like the
best approach.


The permissions info is only used by the toolbar. Individual templates don't need it, because I have an Application module which will centrally check whether a user has a specific privelege before allowing the user access to specific functionality.

The info is stored in a Apache::Session::Postgres object, so each page would have to retrieve the session key from pnotes then use it to retrieve the permissions data from the above session object. I was thinking that since it's the same code in all places, that there would be a way to centralize it in one place (the toolbar) vs scatter it in every page.
IMHO, this would be a cleaner approach, but I may be wrong.






_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to