In our app server which uses template toolkit I wrote a simple permission
system for templates based on users and groups.  It's basically a simple
tree with the document root (top of the tree) always set to public.  Files
in the tree can either belong to a specific group, or if they dont' belong
to a specific group they inherit a group from one of their parents
(traveling up the tree until they find one that has a specific group, or hit
the top in which case they inherit the public group).
Every node in the tree has a name and attributes such as the group, an id, a
parent id, it's depth in the tree, etc..  In our system the group is broken
into effective gid and real gid since we need both because of the
inheritance.

At this point the code is fairly specific to our own use, and I am in the
process of trying to turn it into a standard module that others could use.
My biggest challenge
is figuring out how to store the tree structure and meta information so that
it can be accessed very fast.  In our application we store it in postgresql
but use memcached for fast access of the data.  We also have some parts of
the tree that are always public, so that is stored in a global hash in the
apache/mod perl.  Now this is very fast, but too specific to our system.

So far the best I can come up with is using a backend database for the main
store like we do now, but using a file cache instead of memcached.

Also, is this something there is even any interest for?

Chris


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

Reply via email to