Hi there,
I recently took on a project where I needed to build a hierarchy of taxonomy terms and give users access based on those terms. Naturally the tac_lite module fit the bill. The administrator has the ability to add new terms wherever they want in the hierarchy, and they don't want to have to update the permissions each time.

Alos, I've seen a number of people requesting the feature that this patch offers. Basically, it dynamically allows the permissions of a parent term to cascade to all of its children, recursively. It doesn't write anything to the database or a cache of any sort, so it probably needs some optimization. I optimized it as best I could (taking the number of queries from 29 to 8 on page load, for example). I've also added a checkbox and help text on the admin page of the tac_lite module so that an admin can choose whether or not to allow this inheritance feature.

If you need to set top-level permissions based on terms, and you want all of the children to automatically get the same permissions, this patch is probably a great starting place. It works 100% for me... Please do optimize it. Maybe the tac_lite author wants to clean it up and include it in the next version. Even if you don't use this code, please do include this functionality as I've seen many people searching for it!

Comments

agileadam’s picture

StatusFileSize
new4.96 KB

My last patch has been updated to fix a flaw in the handling of a global variable. Please do not use that patch, in favor of this one.

nickreal03’s picture

This will be very useful! Please someone review it!

Dave Cohen’s picture

The doubt I have about this is that tac_lite permissions will no longer reflect the way in which the node is tagged. That to me seems complicated, not intuitive and not "lite" which is what this module is all about.

I understand the desire for something like this, but I think what you really want is a module to tag the node with all the terms in the inheritance. Not just a module to add grants to node_access. Right? Wouldn't this be better as a third-party module which automatically tags the node with all the ancestor terms after the user selects one term?

Dave Cohen’s picture

Status: Needs review » Closed (won't fix)

Perhaps this module: http://drupal.org/project/hierarchical_select

???

Does it make sense what I'm suggesting?